mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
🐛 fix service stats
This commit is contained in:
@@ -21,11 +21,9 @@ var (
|
||||
Loc *time.Location
|
||||
)
|
||||
|
||||
// Init 初始化singleton
|
||||
func Init() {
|
||||
// 初始化时区至上海 UTF+8
|
||||
func InitTimezoneAndCache() {
|
||||
var err error
|
||||
Loc, err = time.LoadLocation("Asia/Shanghai")
|
||||
Loc, err = time.LoadLocation(Conf.Location)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -75,7 +73,7 @@ func RecordTransferHourlyUsage() {
|
||||
ServerLock.Lock()
|
||||
defer ServerLock.Unlock()
|
||||
now := time.Now()
|
||||
nowTrimSeconds := time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, time.Local)
|
||||
nowTrimSeconds := time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, Loc)
|
||||
var txs []model.Transfer
|
||||
for id, server := range ServerList {
|
||||
tx := model.Transfer{
|
||||
|
||||
Reference in New Issue
Block a user