From 63f76fb281ebcb5aafe78d01a769595dd2918287 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Tue, 14 Sep 2021 20:57:54 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=9A=8F=E6=9C=BA=E6=95=B0=E8=BD=AC?= =?UTF-8?q?=E5=8C=96=E5=BC=82=E5=B8=B8?= 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 b5df470..16398db 100644 --- a/models/wskey.go +++ b/models/wskey.go @@ -5,13 +5,14 @@ import ( "github.com/beego/beego/v2/core/logs" "github.com/robfig/cron/v3" "math/rand" + "strconv" ) func intiSky() { c := cron.New(cron.WithSeconds()) //精确到秒 //定时任务 - spec := "0 " + string(rand.Intn(59)) + " " + Config.CTime + "/12 * * ?" //cron表达式,每秒一次 + spec := "0 " + strconv.Itoa(rand.Intn(59)) + " " + Config.CTime + "/12 * * ?" //cron表达式,每秒一次 logs.Info(spec) c.AddFunc(spec, func() { fmt.Println("开始wskey转换")