mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-18 07:16:50 +08:00
36 lines
691 B
Java
36 lines
691 B
Java
package com.xboe.casetask;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
/**
|
|
* 案例数据同步处理
|
|
*/
|
|
@Slf4j
|
|
@EnableScheduling
|
|
@Component("com.xboe.casetask.CaseDataTimeSchedule")
|
|
public class CaseDataTimeSchedule{
|
|
|
|
@Resource
|
|
CaseDataSyncRunner runner;
|
|
|
|
/**每隔12个小时执行一次*/
|
|
@Scheduled(cron="0 0 12,22 * * ?")
|
|
public void execute() {
|
|
|
|
|
|
try {
|
|
runner.run();
|
|
} catch (Exception e) {
|
|
log.error("同步案例数据错误",e);
|
|
}
|
|
|
|
}
|
|
|
|
}
|