diff --git a/main.go b/main.go index f9a32db..17d658b 100644 --- a/main.go +++ b/main.go @@ -235,11 +235,12 @@ func ReadConfigToSetSystem() { } } //存入redis - data, err := json.Marshal(cron_infos) + json_data, err := json.Marshal(cron_infos) if err != nil { - fmt.Println("Error encoding config") + fmt.Println("ReadConfigToSetSystem Error encoding config,value is :", cron_infos) + } else { + worker.SetRedis(key, string(json_data)) } - worker.SetRedis(key, string(data)) } func RunGeneralCron() { @@ -267,11 +268,13 @@ func RunGeneralCron() { } } //存入redis - data, err := json.Marshal(cron_infos) + json_data, err := json.Marshal(cron_infos) if err != nil { fmt.Println("RunGeneralCron Error encoding config,value is :", cron_infos) + } else { + worker.SetRedis(key, string(json_data)) } - worker.SetRedis(key, string(data)) + } }