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);