Skip to content

Commit 3420b1b

Browse files
author
xueli.xue
committed
日志回调服务
1 parent 87060f4 commit 3420b1b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

xxl-job-core/src/main/java/com/xxl/job/core/handler/HandlerRepository.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,24 @@ public static String service(Map<String, String> _param) {
204204
new Thread(new Runnable() {
205205
@Override
206206
public void run() {
207-
try {
208-
HashMap<String, String> item = callBackQueue.poll();
209-
if (item != null) {
210-
RemoteCallBack callback = null;
211-
try {
212-
callback = HttpUtil.post(item.get("_address"), item);
213-
} catch (Exception e) {
214-
logger.info("HandlerThread Exception:", e);
215-
}
216-
logger.info(">>>>>>>>>>> xxl-job callback , params:{}, result:{}", new Object[]{item, callback});
217-
}
218-
} catch (Exception e) {
207+
while(true){
208+
try {
209+
HashMap<String, String> item = callBackQueue.poll();
210+
if (item != null) {
211+
RemoteCallBack callback = null;
212+
try {
213+
callback = HttpUtil.post(item.get("_address"), item);
214+
} catch (Exception e) {
215+
logger.info("HandlerThread Exception:", e);
216+
}
217+
logger.info(">>>>>>>>>>> xxl-job callback , params:{}, result:{}", new Object[]{item, callback});
218+
}
219+
} catch (Exception e) {
220+
e.printStackTrace();
221+
}
219222
}
220223
}
221-
});
224+
}).start();
222225
}
223226
public static void pushCallBack(String address, HashMap<String, String> params){
224227
params.put("_address", address);

0 commit comments

Comments
 (0)