xdd-plus/models/wskey.go
2021-09-07 01:13:42 +08:00

26 lines
401 B
Go

package models
import (
"github.com/beego/beego/v2/core/logs"
"time"
)
func intiSky(f func()) {
go func() {
for {
f()
now := time.Now()
// 计算下一个零点
next := now.Add(time.Hour * 12)
next = time.Date(next.Year(), next.Month(), next.Day(), 0, 0, 0, 0, next.Location())
t := time.NewTimer(next.Sub(now))
<-t.C
}
}()
}
func pri() {
logs.Info("测试启用")
}