|
@@ -53,7 +53,7 @@ public class MyThreadPool extends ThreadPoolTaskExecutor {
|
|
log.info("cpuNum:{}", cpuNum);
|
|
log.info("cpuNum:{}", cpuNum);
|
|
threadPoolTaskExecutor = new MyThreadPool();
|
|
threadPoolTaskExecutor = new MyThreadPool();
|
|
if (!customThreadPoolCoreSize && cpuNum > 0) {
|
|
if (!customThreadPoolCoreSize && cpuNum > 0) {
|
|
- threadPoolTaskExecutor.setCorePoolSize(Math.abs(cpuNum));//核心线程数
|
|
|
|
|
|
+ threadPoolTaskExecutor.setCorePoolSize(cpuNum);//核心线程数
|
|
threadPoolTaskExecutor.setMaxPoolSize(threadPoolTaskExecutor.getCorePoolSize() * 2);//最大线程数
|
|
threadPoolTaskExecutor.setMaxPoolSize(threadPoolTaskExecutor.getCorePoolSize() * 2);//最大线程数
|
|
} else {
|
|
} else {
|
|
threadPoolTaskExecutor.setCorePoolSize(threadPoolCoreSize);//核心线程数
|
|
threadPoolTaskExecutor.setCorePoolSize(threadPoolCoreSize);//核心线程数
|