修复定时任务未执行问题

This commit is contained in:
junleea 2024-12-15 17:38:35 +08:00
parent f421dda674
commit 645106e3e6
1 changed files with 5 additions and 1 deletions

View File

@ -289,7 +289,7 @@ func RunGeneralCron() {
if err != nil { if err != nil {
fmt.Println("RunGeneralCron Error decoding config,key value is :", res) fmt.Println("RunGeneralCron Error decoding config,key value is :", res)
} }
for _, v := range cron_infos { for i, v := range cron_infos {
//1:日志清理,其他待定 //1:日志清理,其他待定
if v.Type == 1 { if v.Type == 1 {
//日志清理 //日志清理
@ -300,6 +300,8 @@ func RunGeneralCron() {
} else { } else {
v.Curr -= 10 v.Curr -= 10
} }
cron_infos[i] = v
continue
} }
//2 从服务器同步数据 //2 从服务器同步数据
if v.Type == 2 { if v.Type == 2 {
@ -312,6 +314,8 @@ func RunGeneralCron() {
} else { } else {
v.Curr -= 10 v.Curr -= 10
} }
cron_infos[i] = v
continue
} }
} }
//存入redis //存入redis