@ApiModel("***定時任務")
@Component
@Configuration
@EnableScheduling
//@PropertySource("classpath:/***") // 可指定配置文件
public class MatchOpenCheckScheduledTask {
private final Logger log = LoggerFactory.getLogger(this.getClass());
@Scheduled(cron = "${open-check.cron}")
public void openCheckTask(){
log.info("執行‘自動匹配開通校驗’定時任務開始:" + FlowUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss") );
long startTime = System.currentTimeMillis(); //獲取開始時間
/**********************************************************************************************/
/**********************************************************************************************/
long endTime = System.currentTimeMillis(); //獲取結束時間 log.info("執行‘自動匹配開通校驗’定時任務結束:" + FlowUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss") ); log.info("執行時間:"+(endTime - startTime)/1000+" 秒"); }
在線Cron表達式生成器
