wangyuan 2019-07-15 16:50:54 +08:00
parent 5445cc3699
commit e88a8fd3b5
2 changed files with 6 additions and 3 deletions

View File

@ -84,8 +84,6 @@ public class ThreadManager {
int delayForMinute = 60 - (now%60);
LOGGER.info("delayForMinute---->>>>{}" ,delayForMinute);
scheduledExecutor.scheduleAtFixedRate(platConfigureTask, 10, SLEEP_INTEVAL_TIME, TimeUnit.SECONDS);
scheduledExecutor.scheduleAtFixedRate(dataReportTask, 10, SLEEP_INTEVAL_TIME, TimeUnit.SECONDS);
scheduledExecutor.scheduleAtFixedRate(mongoDataHandlerTask, 10, SLEEP_INTEVAL_TIME, TimeUnit.SECONDS);
scheduledExecutor.scheduleAtFixedRate(new MinuteTask(), delayForMinute, 60, TimeUnit.SECONDS);
scheduledExecutor.scheduleAtFixedRate(new Thread(){
public void run () {
@ -98,6 +96,8 @@ public class ThreadManager {
}
}, delayForMinute, 10, TimeUnit.SECONDS);
scheduledExecutor.execute(new RetrySendIndicationThread("retry_send"));
scheduledExecutor.execute(dataReportTask);
scheduledExecutor.execute(mongoDataHandlerTask);
}
public static void reStart(){
LOGGER.info("重启线程池!!");

View File

@ -97,10 +97,13 @@ public class MinuteTask extends Thread {
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
if(hour == 5 && minute ==0){
int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
if(w == 1 &&hour == 5 && minute ==0){
LOGGER.info("everyMondyFiveClockTask start ...");
CombatLogic.getInstance().sendReward();
LOGGER.info("everyMondyFiveClockTask end ...");
}
}
}