|
|
|
@ -5,7 +5,6 @@ import com.xxl.job.admin.core.trigger.XxlJobTrigger;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
|
@ -50,7 +49,7 @@ public class JobTriggerPoolHelper {
|
|
|
|
|
|
|
|
|
|
// job timeout count
|
|
|
|
|
private volatile long minTim = System.currentTimeMillis()/60000; // ms > min
|
|
|
|
|
private volatile Map<Integer, AtomicInteger> jobTimeoutCountMap = new ConcurrentHashMap<>();
|
|
|
|
|
private volatile ConcurrentHashMap<Integer, AtomicInteger> jobTimeoutCountMap = new ConcurrentHashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -89,7 +88,7 @@ public class JobTriggerPoolHelper {
|
|
|
|
|
// incr timeout-count-map
|
|
|
|
|
long cost = System.currentTimeMillis()-start;
|
|
|
|
|
if (cost > 500) { // ob-timeout threshold 500ms
|
|
|
|
|
AtomicInteger timeoutCount = jobTimeoutCountMap.put(jobId, new AtomicInteger(1));
|
|
|
|
|
AtomicInteger timeoutCount = jobTimeoutCountMap.putIfAbsent(jobId, new AtomicInteger(1));
|
|
|
|
|
if (timeoutCount != null) {
|
|
|
|
|
timeoutCount.incrementAndGet();
|
|
|
|
|
}
|
|
|
|
|