From 300f2387863d3e4c547b159ece287219628b44a6 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Mon, 13 Sep 2021 22:16:17 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=9A=8F=E6=9C=BA=E5=88=86=E9=92=9F?= =?UTF-8?q?=E6=95=B0=20=E9=94=99=E5=B3=B0=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/wskey.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/wskey.go b/models/wskey.go index e74d534..b5df470 100644 --- a/models/wskey.go +++ b/models/wskey.go @@ -4,13 +4,14 @@ import ( "fmt" "github.com/beego/beego/v2/core/logs" "github.com/robfig/cron/v3" + "math/rand" ) func intiSky() { c := cron.New(cron.WithSeconds()) //精确到秒 //定时任务 - spec := "0 0 " + Config.CTime + "/12 * * ?" //cron表达式,每秒一次 + spec := "0 " + string(rand.Intn(59)) + " " + Config.CTime + "/12 * * ?" //cron表达式,每秒一次 logs.Info(spec) c.AddFunc(spec, func() { fmt.Println("开始wskey转换")