Преглед на файлове

增加排序相应时间

xueyiming преди 7 месеца
родител
ревизия
d3f24ee95b

+ 2 - 2
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -182,8 +182,7 @@ public class CoreServiceImpl implements CoreService {
     // 定义一个线程池,设置消费线程的数量
     private static final ThreadPoolExecutor matchPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(size);
 
-    private static final int size1 = 20;
-    private static final ThreadPoolExecutor corePoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(size1);
+    private static final ThreadPoolExecutor corePoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(10);
 
 
     @Override
@@ -412,6 +411,7 @@ public class CoreServiceImpl implements CoreService {
 
         if (corePoolExecutor.getCorePoolSize() - corePoolExecutor.getActiveCount() > 0) {
             int threadSize = corePoolExecutor.getCorePoolSize() - corePoolExecutor.getActiveCount();
+            log.info("threadNum={}", threadSize);
             CountDownLatch latch = new CountDownLatch(threadSize);
             // 启动消费者线程
             for (int i = 0; i < threadSize; i++) {

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/SortServiceImpl.java

@@ -25,7 +25,7 @@ public class SortServiceImpl implements SortService {
         int retryTimes = 2;
         while (retryTimes > 0) {
             try {
-                HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 200000, 5, 10, 3, 3000);
+                HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 500000, 5, 10, 3, 3000);
                 retryTimes--;
                 String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(request));
                 log.info("publishArticleSort res={}", res);