From 9b095af68655dece5c13beff38e07ee4c636658b Mon Sep 17 00:00:00 2001 From: gogogjl Date: Wed, 12 Jul 2023 22:51:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=AF=E8=83=BD=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E5=BC=82=E5=B8=B8,=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=A4=87=E6=B3=A8=E6=8F=90=E7=A4=BA,=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=9C=89=E8=AF=AF.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../forest/lucene/service/impl/PortfolioLuceneServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rymcu/forest/lucene/service/impl/PortfolioLuceneServiceImpl.java b/src/main/java/com/rymcu/forest/lucene/service/impl/PortfolioLuceneServiceImpl.java index 07bc0ee..7b31f3e 100644 --- a/src/main/java/com/rymcu/forest/lucene/service/impl/PortfolioLuceneServiceImpl.java +++ b/src/main/java/com/rymcu/forest/lucene/service/impl/PortfolioLuceneServiceImpl.java @@ -56,7 +56,7 @@ public class PortfolioLuceneServiceImpl implements PortfolioLuceneService { int totalCount = list.size(); int perThreadCount = 3000; // 加1避免线程池的参数为0 - int threadCount = totalCount / perThreadCount + (totalCount % perThreadCount == 0 ? 0 : 1); + int threadCount = totalCount / perThreadCount + (totalCount % perThreadCount == 0 ? 1 : 0); ExecutorService pool = Executors.newFixedThreadPool(threadCount); CountDownLatch countDownLatch1 = new CountDownLatch(1); CountDownLatch countDownLatch2 = new CountDownLatch(threadCount);