Commit 71d4c35b by huangfusuper

延长任务的提交动作

parent fbac99cb
......@@ -24,11 +24,11 @@ public class WorkRoulette {
* maxPendingTimeouts:最大等待处理超时
*/
private static final HashedWheelTimer HASHED_WHEEL_TIMER = new HashedWheelTimer(r -> new Thread(r, "HASHED_WHEEL_TIMER" + r.hashCode()), 1, TimeUnit.SECONDS, 8, true, 0);
public static final int INT = 500;
public static final int INT = 1000;
public static void addJob(TimerTask timerTask,long triggerNextTime) {
log.debug("-----任务{}毫秒后执行-------",triggerNextTime-System.currentTimeMillis());
log.info("-----任务{}毫秒后执行-------",triggerNextTime-System.currentTimeMillis());
//设置这个的根部原因是因为保证任务的抛出在事务提交动作完成之后抛出
long time = triggerNextTime-System.currentTimeMillis();
if(time < INT){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment