zhangqian
2023-09-17 81cf60c31e0c4dc07704c517e001a89e8432d2f6
定时任务启动服务不立即执行
1个文件已修改
4 ■■■■ 已修改文件
crontask/cron_task.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
crontask/cron_task.go
@@ -24,7 +24,7 @@
        totalNumberTimeInterval = 60
    }
    s := gocron.NewScheduler(time.UTC)
    _, err := s.Every(finishNumberTimeInterval).Seconds().StartImmediately().Do(func() {
    _, err := s.Every(finishNumberTimeInterval).Seconds().Do(func() {
        plcConfig, code := service.NewDevicePlcService().GetDevicePlc()
        if code != ecode.OK {
            return
@@ -73,7 +73,7 @@
    })
    s.Every(60).Seconds().StartImmediately().Do(SyncProductionProgress) //同步生产数据
    s.Every(180).Seconds().Do(SyncProductionProgress) //同步生产数据
    s.StartAsync()
    return nil
}