|
|
@@ -13,7 +13,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
|
-import org.springframework.scheduling.support.CronTrigger;
|
|
|
+import org.springframework.scheduling.support.PeriodicTrigger;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -45,12 +45,12 @@ public class TaskCollectService {
|
|
|
|
|
|
public void startReported(DtoPolicy policyDto) {
|
|
|
stopReported();
|
|
|
- String cron = properties.getPlatform().getCollectCron();
|
|
|
+ long delayMillis = properties.getPlatform().getDelayMillis();
|
|
|
future = threadPoolTaskScheduler.schedule(() -> {
|
|
|
log.info("###### 执行上报采集数据 ######");
|
|
|
reportPolicy(policyDto);
|
|
|
- }, triggerContext -> new CronTrigger(cron).nextExecutionTime(triggerContext));
|
|
|
- log.info("###### 开始上报采集数据定时,cron: {} ######", cron);
|
|
|
+ }, triggerContext -> new PeriodicTrigger(delayMillis).nextExecutionTime(triggerContext));
|
|
|
+ log.info("###### 开始上报采集数据定时,delayMillis: {} ######", delayMillis);
|
|
|
}
|
|
|
|
|
|
public void stopReported() {
|