From f76c68a87261cf2396a64c7125324c24483d4623 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期二, 09 六月 2026 09:46:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao
---
server/system_timer/src/main/java/com/doumee/config/AsyncPoolConfig.java | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/server/system_timer/src/main/java/com/doumee/config/AsyncPoolConfig.java b/server/system_timer/src/main/java/com/doumee/config/AsyncPoolConfig.java
new file mode 100644
index 0000000..d327a39
--- /dev/null
+++ b/server/system_timer/src/main/java/com/doumee/config/AsyncPoolConfig.java
@@ -0,0 +1,29 @@
+package com.doumee.config;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+
+@Slf4j
+@Configuration
+public class AsyncPoolConfig implements AsyncConfigurer {
+
+ @Bean("asyncExecutor")
+ @Override
+ public Executor getAsyncExecutor() {
+ ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+ executor.setCorePoolSize(5);
+ executor.setMaxPoolSize(20);
+ executor.setQueueCapacity(100);
+ executor.setKeepAliveSeconds(60);
+ executor.setThreadNamePrefix("async-timer-");
+ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+ executor.initialize();
+ return executor;
+ }
+}
--
Gitblit v1.9.3