From e3f8089c830d5c6e7477090cf447bed65e80be9f Mon Sep 17 00:00:00 2001
From: zhijie <1003392067@qq.com>
Date: 星期一, 19 九月 2022 00:38:39 +0800
Subject: [PATCH] 优化导出报告

---
 src/main/java/com/ots/framework/config/ThreadPoolConfig.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/ots/framework/config/ThreadPoolConfig.java b/src/main/java/com/ots/framework/config/ThreadPoolConfig.java
index 4293f31..96e9d59 100644
--- a/src/main/java/com/ots/framework/config/ThreadPoolConfig.java
+++ b/src/main/java/com/ots/framework/config/ThreadPoolConfig.java
@@ -11,13 +11,14 @@
 @Configuration
 public class ThreadPoolConfig {
     
-    private int corePoolSize = 50;
+    private int corePoolSize = 5;
     
-    private int maxPoolSize = 200;
+    private int maxPoolSize = 20;
     
-    private int queueCapacity = 1000;
+    private int queueCapacity = 100;
     
-    private int keepAliveSeconds = 300;
+    private int keepAliveSeconds = 60;
+
     @Bean(name = "threadPoolTaskExecutor")
     public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
         ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
@@ -25,6 +26,8 @@
         executor.setCorePoolSize(corePoolSize);
         executor.setQueueCapacity(queueCapacity);
         executor.setKeepAliveSeconds(keepAliveSeconds);
+        //绾跨▼鍓嶇紑鍚嶇О
+        executor.setThreadNamePrefix("thread-pool-%d");
         
         executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
         return executor;

--
Gitblit v1.9.1