提交 416c7489 编写于 作者: X xueli.xue

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

上级 4f3f5e84
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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册