diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerThread.java b/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerThread.java index 8896a5a9..b5666b0a 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerThread.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerThread.java @@ -1,5 +1,13 @@ package com.xxl.job.core.handler; +import com.xxl.job.core.handler.HandlerRepository.HandlerParamEnum; +import com.xxl.job.core.handler.IJobHandler.JobHandleStatus; +import com.xxl.job.core.log.XxlJobFileAppender; +import com.xxl.job.core.util.HttpUtil; +import org.eclipse.jetty.util.ConcurrentHashSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.PrintWriter; import java.io.StringWriter; import java.util.HashMap; @@ -7,15 +15,6 @@ import java.util.Map; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.ConcurrentHashSet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.xxl.job.core.handler.HandlerRepository.HandlerParamEnum; -import com.xxl.job.core.handler.IJobHandler.JobHandleStatus; -import com.xxl.job.core.log.XxlJobFileAppender; -import com.xxl.job.core.util.HttpUtil; - /** * handler thread * @author xuxueli 2016-1-16 19:52:47 @@ -57,7 +56,7 @@ public class HandlerThread extends Thread{ public void run() { while(!toStop){ try { - Map handlerData = handlerDataQueue.poll(); + Map handlerData = handlerDataQueue.poll(3L ,TimeUnit.SECONDS); if (handlerData!=null) { i= 0; String log_address = handlerData.get(HandlerParamEnum.LOG_ADDRESS.name());