Parcourir la source

推送时间修改为29分钟并启动程序立即执行一次

fuyuchuan il y a 17 heures
Parent
commit
120084f575

+ 2 - 1
service-cdi/service-cdi-biz/src/main/java/com/usky/cdi/service/util/DeviceDataSyncService.java

@@ -34,8 +34,9 @@ public class DeviceDataSyncService {
      * cron表达式:0 0,30 * * * ? → 秒 分 时 日 月 周 年
      * 含义:每分钟的0秒、分=0或30、小时任意、日期/月份/星期任意
      */
-    @Scheduled(cron = "0 0,30 * * * ?")
     // @Scheduled(cron = "*/30 * * * * ?")
+    // @Scheduled(cron = "0 0,30 * * * ?")
+    @Scheduled(fixedRate = 29 * 60 * 1000, initialDelay = 0)
     public void scheduledDeviceDataSync() {
         try {
             iotDataTransferService.synchronizeDeviceData();