【采集调度器-后端TCP API】采集调度器下发任务命令 API
parent
490d8bbbc1
commit
6acba2661e
@ -0,0 +1,25 @@
|
||||
package com.docus.server.common;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SchedulerTask {
|
||||
|
||||
//定时任务
|
||||
// 5 * * * * ? 在每分钟的5秒执行
|
||||
@Scheduled(cron = "0/1 * * * * ?")
|
||||
public void scheduleTask() {
|
||||
try {
|
||||
log.info("定时任务: 开始执行");
|
||||
//todo:执行业务
|
||||
log.info("定时任务: 执行完毕");
|
||||
} catch (Exception e) {
|
||||
log.error("定时任务执行出错", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue