From fee67ca8a0760315047a52fc4101a8f4f80b7a7f Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 11 十一月 2024 15:02:54 +0800 Subject: [PATCH] 1 --- src/main/java/com/moon/server/config/ThreadPoolConfig.java | 22 +--------------------- 1 files changed, 1 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/moon/server/config/ThreadPoolConfig.java b/src/main/java/com/moon/server/config/ThreadPoolConfig.java index 1c64526..bdbb21e 100644 --- a/src/main/java/com/moon/server/config/ThreadPoolConfig.java +++ b/src/main/java/com/moon/server/config/ThreadPoolConfig.java @@ -9,31 +9,15 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor; -/** - * 绾跨▼姹犻厤缃被 - * @author WWW - * @date 2023-07-10 - */ @Configuration +@SuppressWarnings("ALL") public class ThreadPoolConfig { - /** - * 鏍稿績绾跨▼姹犲ぇ灏� - */ private final static int CORE_POOL_SIZE = 50; - /** - * 鏈�澶у彲鍒涘缓鐨勭嚎绋嬫暟 - */ private final static int MAX_POOL_SIZE = 200; - /** - * 闃熷垪鏈�澶ч暱搴� - */ private final static int QUEUE_CAPACITY = 1000; - /** - * 绾跨▼姹犵淮鎶ょ嚎绋嬫墍鍏佽鐨勭┖闂叉椂闂� - */ private final static int KEEP_ALIVE_SECONDS = 300; @Bean(name = "threadPoolTaskExecutor") @@ -43,15 +27,11 @@ executor.setCorePoolSize(CORE_POOL_SIZE); executor.setQueueCapacity(QUEUE_CAPACITY); executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS); - // 绾跨▼姹犲鎷掔粷浠诲姟(鏃犵嚎绋嬪彲鐢�)鐨勫鐞嗙瓥鐣� executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor; } - /** - * 鎵ц鍛ㄦ湡鎬ф垨瀹氭椂浠诲姟 - */ @Bean(name = "scheduledExecutorService") protected ScheduledExecutorService scheduledExecutorService() { return new ScheduledThreadPoolExecutor(CORE_POOL_SIZE, -- Gitblit v1.9.3