From f7ff8047396f31a211d6f2928c13c2adcd29f97b Mon Sep 17 00:00:00 2001 From: "xueli.xue" Date: Wed, 20 Jul 2016 12:37:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C=E9=98=9F?= =?UTF-8?q?=E5=88=97,=E9=87=87=E7=94=A8Poll(Timeout)=E6=96=B9=E5=BC=8F;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xxl/job/core/handler/HandlerThread.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 13003cc0..e834b22e 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 @@ -13,6 +13,7 @@ import java.io.StringWriter; import java.util.HashMap; import java.util.Map; import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; /** * handler thread @@ -55,7 +56,7 @@ public class HandlerThread extends Thread{ public void run() { while(!toStop){ try { - Map handlerData = handlerDataQueue.take(); + Map handlerData = handlerDataQueue.poll(3L, TimeUnit.SECONDS); if (handlerData!=null) { i= 0; String log_address = handlerData.get(HandlerParamEnum.LOG_ADDRESS.name());