From d19fec73d4c4b4a01f6786e5966d505b34795d19 Mon Sep 17 00:00:00 2001 From: vishun Date: Tue, 30 Aug 2022 13:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=8E=BB=E9=87=8D=E6=89=80?= =?UTF-8?q?=E7=94=A8=E7=BA=BF=E7=A8=8B=E6=B1=A0=E8=AE=BE=E7=BD=AE=E4=B8=BA?= =?UTF-8?q?daemon=E7=BA=BF=E7=A8=8B=EF=BC=8C=E5=90=A6=E5=88=99jvm=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=90=8E=E7=BA=BF=E7=A8=8B=E6=B1=A0=E4=BB=8D=E4=B8=8D?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/WxMessageInMemoryDuplicateCheckerSingleton.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxMessageInMemoryDuplicateCheckerSingleton.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxMessageInMemoryDuplicateCheckerSingleton.java index 7c50ba1ec..befd367fe 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxMessageInMemoryDuplicateCheckerSingleton.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxMessageInMemoryDuplicateCheckerSingleton.java @@ -12,8 +12,8 @@ import java.util.concurrent.TimeUnit; * @author jiangby * @version 1.0 *

- * 消息去重,记录消息ID首次出现时的时间戳, - * 15S后定时任务触发时废除该记录消息ID + * 消息去重,记录消息ID首次出现时的时间戳, + * 15S后定时任务触发时废除该记录消息ID *

* created on 2022/5/26 1:32 */ @@ -34,7 +34,7 @@ public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDupl * 线程池 */ private static final ScheduledThreadPoolExecutor SCHEDULED_THREAD_POOL_EXECUTOR = new ScheduledThreadPoolExecutor(1, - new ThreadFactoryBuilder().setNameFormat("wxMessage-memory-pool-%d").build(), new ThreadPoolExecutor.AbortPolicy()); + new ThreadFactoryBuilder().setNameFormat("wxMessage-memory-pool-%d").setDaemon(true).build(), new ThreadPoolExecutor.AbortPolicy()); /** * 消息id->消息时间戳的map. @@ -71,7 +71,7 @@ public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDupl * 内部类实现单例 */ private static class WxMessageInnerClass { - static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton(); + static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton(); } /**