From a850200a330feceb0e64650bb6dfc47eec5478c7 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期三, 27 三月 2024 09:34:30 +0800
Subject: [PATCH] 优化雷达日志
---
src/main/java/com/ard/config/AsyncConfiguration.java | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ard/config/AsyncConfiguration.java b/src/main/java/com/ard/config/AsyncConfiguration.java
index 186acc5..c7a0fe2 100644
--- a/src/main/java/com/ard/config/AsyncConfiguration.java
+++ b/src/main/java/com/ard/config/AsyncConfiguration.java
@@ -25,6 +25,27 @@
//閰嶇疆闃熷垪澶у皬
executor.setQueueCapacity(1000);
//绾跨▼鐨勫悕绉板墠缂�
+ executor.setThreadNamePrefix("alarmExecutor-");
+ //绾跨▼娲昏穬鏃堕棿锛堢锛�
+ //executor.setKeepAliveSeconds(60);
+ //绛夊緟鎵�鏈変换鍔$粨鏉熷悗鍐嶅叧闂嚎绋嬫睜
+ executor.setWaitForTasksToCompleteOnShutdown(true);
+ //璁剧疆鎷掔粷绛栫暐
+ //executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+ //鎵ц鍒濆鍖�
+ executor.initialize();
+ return executor;
+ }
+ @Bean("exec")
+ public ThreadPoolTaskExecutor executor(){
+ ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+ //閰嶇疆鏍稿績绾跨▼鏁�
+ executor.setCorePoolSize(15);
+ //閰嶇疆鏈�澶х嚎绋嬫暟
+ executor.setMaxPoolSize(30);
+ //閰嶇疆闃熷垪澶у皬
+ executor.setQueueCapacity(1000);
+ //绾跨▼鐨勫悕绉板墠缂�
executor.setThreadNamePrefix("Executor-");
//绾跨▼娲昏穬鏃堕棿锛堢锛�
//executor.setKeepAliveSeconds(60);
@@ -36,4 +57,4 @@
executor.initialize();
return executor;
}
-}
\ No newline at end of file
+}
--
Gitblit v1.9.3