Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 多个实例导致多个守护线程的问题,修改成单例+定时任务线程池处理 #2663

Merged
merged 1 commit into from
May 27, 2022

Conversation

helloworldByChinese
Copy link

Fix 多个实例导致多个守护线程的问题,修改成单例+定时任务线程池处理

@binarywang binarywang merged commit 95be03b into Wechat-Group:develop May 27, 2022
@nadirvishun
Copy link

nadirvishun commented Aug 25, 2022

有看到定时任务线程池,麻烦提供一个shutdown线程池关闭方法,否则优雅关闭都会受到影响。
感觉可以放到各模块的shutDownExecutorService方法中,与路由线程池一并结束。


也可以不用增加shutdown方法,将线程设置为daemon线程也行,这样比较简单点:

 private static final ScheduledThreadPoolExecutor SCHEDULED_THREAD_POOL_EXECUTOR = new ScheduledThreadPoolExecutor(1,
    new ThreadFactoryBuilder().setNameFormat("wxMessage-memory-pool-%d").setDaemon(true).build(), new ThreadPoolExecutor.AbortPolicy());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants