🐛 修复 portfolioLucene 线程池报错问题
This commit is contained in:
commit
6d578179c2
@ -56,7 +56,7 @@ public class PortfolioLuceneServiceImpl implements PortfolioLuceneService {
|
|||||||
int totalCount = list.size();
|
int totalCount = list.size();
|
||||||
int perThreadCount = 3000;
|
int perThreadCount = 3000;
|
||||||
// 加1避免线程池的参数为0
|
// 加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);
|
ExecutorService pool = Executors.newFixedThreadPool(threadCount);
|
||||||
CountDownLatch countDownLatch1 = new CountDownLatch(1);
|
CountDownLatch countDownLatch1 = new CountDownLatch(1);
|
||||||
CountDownLatch countDownLatch2 = new CountDownLatch(threadCount);
|
CountDownLatch countDownLatch2 = new CountDownLatch(threadCount);
|
||||||
|
Loading…
Reference in New Issue
Block a user