1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Correct core size of the pool

This commit is contained in:
lichen782 2019-09-17 09:26:08 +08:00
parent b83b1b78dc
commit d195ebd299

View File

@ -50,8 +50,9 @@ public class OssAutoConfiguration {
@Bean(name = OSS_TASK_EXECUTOR_BEAN_NAME)
@ConditionalOnMissingBean
public ExecutorService ossTaskExecutor() {
return new ThreadPoolExecutor(8, 128,
60, TimeUnit.SECONDS, new SynchronousQueue<>());
int coreSize = Runtime.getRuntime().availableProcessors();
return new ThreadPoolExecutor(coreSize, 128, 60, TimeUnit.SECONDS,
new SynchronousQueue<>());
}
}