mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-19 20:40:26 +08:00
优化代码:使用fasttime取代以往的utils.UnixTime
This commit is contained in:
@@ -2,6 +2,7 @@ package ttlcache
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/fasttime"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -74,7 +75,7 @@ func (this *Cache) Write(key string, value interface{}, expiredAt int64) (ok boo
|
||||
return
|
||||
}
|
||||
|
||||
var currentTimestamp = utils.UnixTime()
|
||||
var currentTimestamp = fasttime.Now().Unix()
|
||||
if expiredAt <= currentTimestamp {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user