From 4449b0b044e8aaed951e95d09498ec2519659cbd Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Mon, 27 Sep 2021 14:53:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A012=E5=B0=8F=E6=97=B6Ck?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E7=A6=81=E7=94=A8=E6=A3=80=E6=B5=8B=20?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E9=85=8D=E7=BD=AECtime=20=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E5=88=86=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/cron.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/cron.go b/models/cron.go index 2a92796..c02916d 100644 --- a/models/cron.go +++ b/models/cron.go @@ -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()