[Change] 调整应用内事件线程池参数;

[Change] BotEventHandler 调整线程池参数;
This commit is contained in:
LamGC 2020-07-13 09:42:33 +08:00
parent a606ec0423
commit 0fc3e3ab48
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -46,9 +46,9 @@ public class BotEventHandler implements EventHandler {
* 消息事件执行器 * 消息事件执行器
*/ */
private final static EventExecutor executor = new EventExecutor(new TimeLimitThreadPoolExecutor( private final static EventExecutor executor = new EventExecutor(new TimeLimitThreadPoolExecutor(
180000, // 3minThr 180000, // 3min limit
Math.max(Runtime.getRuntime().availableProcessors(), 4), Math.max(Runtime.getRuntime().availableProcessors(), 4), // 4 ~ processors
Math.min(Math.max(Runtime.getRuntime().availableProcessors(), 4), 32), Math.min(Math.max(Runtime.getRuntime().availableProcessors() * 2, 8), 32),// (8 ~ processors * 2) ~ 32
30L, 30L,
TimeUnit.SECONDS, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(1536), new LinkedBlockingQueue<>(1536),