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