From ac1a4a027a7bd88efb32e9da666bdba4b5fa166f Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 14 一月 2022 17:04:26 +0800
Subject: [PATCH] 支持国标级联的目录订阅功能

---
 src/main/java/com/genersoft/iot/vmp/conf/ThreadPoolTaskConfig.java |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/conf/ThreadPoolTaskConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/ThreadPoolTaskConfig.java
index f2edf04..1bc8521 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/ThreadPoolTaskConfig.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/ThreadPoolTaskConfig.java
@@ -8,8 +8,10 @@
 import java.util.concurrent.ThreadPoolExecutor;
 
 @Configuration
-@EnableAsync
+@EnableAsync(proxyTargetClass = true)
 public class ThreadPoolTaskConfig {
+
+    public static final int cpuNum = Runtime.getRuntime().availableProcessors();
 
     /**
      *   榛樿鎯呭喌涓嬶紝鍦ㄥ垱寤轰簡绾跨▼姹犲悗锛岀嚎绋嬫睜涓殑绾跨▼鏁颁负0锛屽綋鏈変换鍔℃潵涔嬪悗锛屽氨浼氬垱寤轰竴涓嚎绋嬪幓鎵ц浠诲姟锛�
@@ -20,11 +22,11 @@
     /**
      * 鏍稿績绾跨▼鏁帮紙榛樿绾跨▼鏁帮級
      */
-    private static final int corePoolSize = 5;
+    private static final int corePoolSize = cpuNum;
     /**
      * 鏈�澶х嚎绋嬫暟
      */
-    private static final int maxPoolSize = 30;
+    private static final int maxPoolSize = cpuNum*2;
     /**
      * 鍏佽绾跨▼绌洪棽鏃堕棿锛堝崟浣嶏細榛樿涓虹锛�
      */
@@ -32,11 +34,11 @@
     /**
      * 缂撳啿闃熷垪澶у皬
      */
-    private static final int queueCapacity = 10000;
+    private static final int queueCapacity = 500;
     /**
      * 绾跨▼姹犲悕鍓嶇紑
      */
-    private static final String threadNamePrefix = "hdl-uhi-service-";
+    private static final String threadNamePrefix = "wvp-";
 
     @Bean("taskExecutor") // bean鐨勫悕绉帮紝榛樿涓洪瀛楁瘝灏忓啓鐨勬柟娉曞悕
     public ThreadPoolTaskExecutor taskExecutor() {

--
Gitblit v1.8.0