package work import ( "github.com/robfig/cron" "server/modbus" "server/service" "server/utils" ) func MyJob() { c := cron.New() _ = c.AddFunc("0 * * * * ?", func() { modbus.GetSunPowerInfo() modbus.GetDeviceInfo() }) _ = c.AddFunc("0 * * * * ?", func() { service.Cron{}.RelayOnOffTimeTask() modbus.DealWithOffline() }) _ = c.AddFunc("0 */30 * * * ?", func() { utils.SaveData("./static/data.json", utils.InitRegionData) }) c.Start() }