整点执行
parent
a17ef696d3
commit
5fd58a3472
|
|
@ -59,12 +59,13 @@ public class ThreadManager {
|
|||
|
||||
|
||||
public void go() {
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
scheduledExecutor = new ScheduledThreadPoolExecutor(16, new ScheduleThreadFactory());
|
||||
|
||||
// testTask 已秒为单位 延迟10s, 间隔30s为周期执行
|
||||
scheduledExecutor.scheduleAtFixedRate(platConfigureTask, 10, PlatConfigureTask.SLEEP_INTEVAL_TIME, TimeUnit.SECONDS);
|
||||
scheduledExecutor.scheduleAtFixedRate(new MinuteJob(), 0, 60, TimeUnit.SECONDS);
|
||||
long diff = now/1000 % 60 ;
|
||||
scheduledExecutor.scheduleAtFixedRate(new MinuteJob(), 60 - diff, 60, TimeUnit.SECONDS);
|
||||
LOGGER.info("All Task running ...");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue