mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-04 20:57:47 +08:00
🎨 修改消息去重时线程池关闭问题
This commit is contained in:
commit
3918005b1f
@ -12,8 +12,8 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* @author jiangby
|
* @author jiangby
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* <p>
|
* <p>
|
||||||
* 消息去重,记录消息ID首次出现时的时间戳,
|
* 消息去重,记录消息ID首次出现时的时间戳,
|
||||||
* 15S后定时任务触发时废除该记录消息ID
|
* 15S后定时任务触发时废除该记录消息ID
|
||||||
* </p>
|
* </p>
|
||||||
* created on 2022/5/26 1:32
|
* 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,
|
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.
|
* 消息id->消息时间戳的map.
|
||||||
@ -71,7 +71,7 @@ public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDupl
|
|||||||
* 内部类实现单例
|
* 内部类实现单例
|
||||||
*/
|
*/
|
||||||
private static class WxMessageInnerClass {
|
private static class WxMessageInnerClass {
|
||||||
static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton();
|
static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user