fix:(1.2.0-beta2): 修复客户端获取线程时的并发问题
This commit is contained in:
parent
580686dd6b
commit
ada892157d
@ -45,7 +45,11 @@ public class ThreadPoolCache {
|
||||
};
|
||||
|
||||
ThreadPoolExecutor threadPoolExecutor = supplier.get();
|
||||
CACHE_THREAD_POOL.putIfAbsent(taskBatchId, threadPoolExecutor);
|
||||
ThreadPoolExecutor cacheThreadPoolExecutor = CACHE_THREAD_POOL.putIfAbsent(taskBatchId, threadPoolExecutor);
|
||||
if (Objects.nonNull(cacheThreadPoolExecutor) && cacheThreadPoolExecutor != threadPoolExecutor) {
|
||||
cacheThreadPoolExecutor.setCorePoolSize(Math.min(parallelNum, cacheThreadPoolExecutor.getMaximumPoolSize()));
|
||||
return cacheThreadPoolExecutor;
|
||||
}
|
||||
return threadPoolExecutor;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user