|
@@ -3,8 +3,7 @@ package org.eco.als.task;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.eco.als.service.IFaultStatisticsService;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
-import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -17,14 +16,13 @@ import org.springframework.stereotype.Component;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
-@EnableAsync
|
|
|
@EnableScheduling
|
|
|
+@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true")
|
|
|
public class FaultTask {
|
|
|
@Resource
|
|
|
private IFaultStatisticsService faultStatisticsService;
|
|
|
|
|
|
- @Async("TaskExecutor")
|
|
|
- @Scheduled(cron = "0 */30 * * * *")
|
|
|
+ @Scheduled(cron = "0 */1 * * * *")
|
|
|
public void faultStatisticsTask() {
|
|
|
log.info("获取ZK故障信息定时任务=========开始");
|
|
|
faultStatisticsService.getExtraStatistics();
|