优化代码:使用fasttime取代以往的utils.UnixTime

This commit is contained in:
GoEdgeLab
2023-04-08 12:47:04 +08:00
parent 511e0d409f
commit f3da37046a
22 changed files with 208 additions and 137 deletions

View File

@@ -1,7 +1,7 @@
package nodes
import (
"github.com/TeaOSLab/EdgeNode/internal/utils"
"github.com/TeaOSLab/EdgeNode/internal/utils/fasttime"
"net/http"
)
@@ -15,7 +15,7 @@ type HTTPClient struct {
func NewHTTPClient(rawClient *http.Client) *HTTPClient {
return &HTTPClient{
rawClient: rawClient,
accessAt: utils.UnixTime(),
accessAt: fasttime.Now().Unix(),
}
}
@@ -26,7 +26,7 @@ func (this *HTTPClient) RawClient() *http.Client {
// UpdateAccessTime 更新访问时间
func (this *HTTPClient) UpdateAccessTime() {
this.accessAt = utils.UnixTime()
this.accessAt = fasttime.Now().Unix()
}
// AccessTime 获取访问时间