mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-20 16:26:50 +08:00
一基的服务与模板重新建立一个环境
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user