fix 增加12小时Ck过期禁用检测 需要配置Ctime 随机分钟

This commit is contained in:
ZJY 2021-09-27 14:53:14 +08:00
parent 94f23cbc5f
commit 4449b0b044

View File

@ -3,6 +3,8 @@ package models
import (
"github.com/beego/beego/v2/adapter/logs"
"github.com/robfig/cron/v3"
"math/rand"
"strconv"
)
var c *cron.Cron
@ -18,6 +20,7 @@ func initCron() {
}
c.AddFunc("3 */1 * * *", initVersion)
c.AddFunc("40 */1 * * *", GitPullAll)
c.AddFunc("0 "+strconv.Itoa(rand.Intn(59))+" "+Config.CTime+"/12 * * ?", initCookie)
}
c.Start()