feat:新增定时任务 删除jwt

This commit is contained in:
songzhibin97
2021-09-01 17:56:51 +08:00
parent 4a2390f147
commit b36c58bd03
2 changed files with 3 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ import (
func Timer() {
if global.GVA_CONFIG.Timer.Start {
for _, detail := range global.GVA_CONFIG.Timer.Detail {
for i := range global.GVA_CONFIG.Timer.Detail {
go func(detail config.Detail) {
global.GVA_Timer.AddTaskByFunc("ClearDB", global.GVA_CONFIG.Timer.Spec, func() {
err := utils.ClearTable(global.GVA_DB, detail.TableName, detail.CompareField, detail.Interval)
@@ -18,7 +18,7 @@ func Timer() {
fmt.Println("timer error:", err)
}
})
}(detail)
}(global.GVA_CONFIG.Timer.Detail[i])
}
}
}