修复一处queue.poll导致的cpu占满的问题 (该问题在v1.4版本于7月份已经修复, v1.3版本仍然遗留该问题,现在同步修复掉, 推荐更新最新版本保证逻辑实时稳定)

v1.3
xueli.xue 8 years ago
parent 4f3f5e849c
commit 416c7489c8

@ -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<String, String> handlerData = handlerDataQueue.poll();
Map<String, String> handlerData = handlerDataQueue.poll(3L ,TimeUnit.SECONDS);
if (handlerData!=null) {
i= 0;
String log_address = handlerData.get(HandlerParamEnum.LOG_ADDRESS.name());

Loading…
Cancel
Save