From 6b8ded1349b597e407f3eba732722905e07e9856 Mon Sep 17 00:00:00 2001 From: String <120284546@qq.com> Date: Tue, 7 May 2019 14:52:55 +0800 Subject: [PATCH] Update JobTriggerPoolHelper.java --- .../com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java index 7a3a733c..6352f53d 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java @@ -50,7 +50,7 @@ public class JobTriggerPoolHelper { // job timeout count private volatile long minTim = System.currentTimeMillis()/60000; // ms > min - private volatile Map jobTimeoutCountMap = new ConcurrentHashMap<>(); + private volatile ConcurrentHashMap jobTimeoutCountMap = new ConcurrentHashMap<>(); /** @@ -89,7 +89,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(); }