From 3420b1bd481307ce81897a1ed8c35d9f13ad5af1 Mon Sep 17 00:00:00 2001 From: "xueli.xue" Date: Sat, 28 May 2016 20:16:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=9B=9E=E8=B0=83=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/core/handler/HandlerRepository.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerRepository.java b/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerRepository.java index 3a55f9c4..15762b35 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerRepository.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerRepository.java @@ -204,21 +204,24 @@ public class HandlerRepository { new Thread(new Runnable() { @Override public void run() { - try { - HashMap item = callBackQueue.poll(); - if (item != null) { - RemoteCallBack callback = null; - try { - callback = HttpUtil.post(item.get("_address"), item); - } catch (Exception e) { - logger.info("HandlerThread Exception:", e); - } - logger.info(">>>>>>>>>>> xxl-job callback , params:{}, result:{}", new Object[]{item, callback}); - } - } catch (Exception e) { + while(true){ + try { + HashMap item = callBackQueue.poll(); + if (item != null) { + RemoteCallBack callback = null; + try { + callback = HttpUtil.post(item.get("_address"), item); + } catch (Exception e) { + logger.info("HandlerThread Exception:", e); + } + logger.info(">>>>>>>>>>> xxl-job callback , params:{}, result:{}", new Object[]{item, callback}); + } + } catch (Exception e) { + e.printStackTrace(); + } } } - }); + }).start(); } public static void pushCallBack(String address, HashMap params){ params.put("_address", address);