From e48f40a4ad55847f7a395fdbae31579668c94ef7 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Wed, 29 Sep 2021 09:26:05 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=95=B4?= =?UTF-8?q?=E7=82=B9=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/wskey.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/models/wskey.go b/models/wskey.go index b6cd122..10ca202 100644 --- a/models/wskey.go +++ b/models/wskey.go @@ -4,15 +4,13 @@ import ( "fmt" "github.com/beego/beego/v2/core/logs" "github.com/robfig/cron/v3" - "math/rand" - "strconv" ) func intiSky() { c := cron.New(cron.WithSeconds()) //精确到秒 //定时任务 - spec := "0 " + strconv.Itoa(rand.Intn(59)) + " " + Config.CTime + "/12 * * ?" //cron表达式,每秒一次 + spec := "0 0" + Config.CTime + "/12 * * ?" //cron表达式,每秒一次 logs.Info(spec) if Config.Wskey { c.AddFunc(spec, func() {