From bea79cde84592bb012edf53c2032ddd85cd539f4 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Thu, 23 May 2019 15:44:27 +0800 Subject: [PATCH] update document --- .../com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java | 5 ++--- 1 file changed, 2 insertions(+), 3 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 1366712e..9d6fdf1d 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 @@ -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 jobTimeoutCountMap = new ConcurrentHashMap<>(); + private volatile ConcurrentHashMap 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(); }