Authored by chaogeng

修改定时任务

... ... @@ -23,24 +23,26 @@ public class LuckyUserNoticeThread {
public LuckyUserNoticeThread(){
if(PropertiesUtil.getExecuteTask()){
//(1)定时任务执行时间间隔,单位为分
DynamicLongProperty initialDelay = DynamicPropertyFactory.getInstance().getLongProperty("drawline.luckyUserNotice.interval", 120);
//(1)定时任务执行时间间隔,单位为分
DynamicLongProperty initialDelay = DynamicPropertyFactory.getInstance().getLongProperty("drawline.luckyUserNotice.interval", 120);
//(2)服务启动10后开始执行, 默认每隔2小时执行一次
Const.LUCKYUSERNOTICE_EXE.scheduleAtFixedRate(new Runnable() {
//(2)服务启动10后开始执行, 默认每隔2小时执行一次
Const.LUCKYUSERNOTICE_EXE.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
logger.info("LuckyUserNotice thread start...");
timeTaskService.luckyUserNotice();
logger.info("LuckyUserNotice thread end.");
@Override
public void run() {
//(3)判断定时任务配置,true时执行定时任务,false不执行
if (!PropertiesUtil.getExecuteTask()) {
return;
}
}, 10, initialDelay.get(), TimeUnit.MINUTES);
}
logger.info("LuckyUserNotice thread start...");
timeTaskService.luckyUserNotice();
logger.info("LuckyUserNotice thread end.");
}
}, 10, initialDelay.get(), TimeUnit.MINUTES);
}
}
... ...