diff --git a/handler/cid.go b/handler/cid.go index cd1010d..afd4137 100644 --- a/handler/cid.go +++ b/handler/cid.go @@ -233,6 +233,7 @@ func RunCron() { //如果没有定时任务,查找数据库是否有定时任务,如果有,则加入redis,如果没有,则不做任何操作 key := "cron_cid_runs" res := worker.GetRedis(key) + fmt.Println("cid run cron res:", res) if res == "" { cids := dao.FindCIDByTime() cid_workers := make([]proto.CIDRUN, 0) @@ -250,8 +251,7 @@ func RunCron() { } } else { var cid_workers []proto.CIDRUN - cid_redis_workers := worker.GetRedis(key) - err := json.Unmarshal([]byte(cid_redis_workers), &cid_workers) + err := json.Unmarshal([]byte(res), &cid_workers) if err != nil { fmt.Println("json unmarshal failed") }