核心线程与最大线程配置修改

This commit is contained in:
zsz 2022-06-09 16:05:27 +08:00
parent 0700c60636
commit 38a28408ca

View File

@ -33,8 +33,8 @@ public class ThreadPoolConfig {
@ConditionalOnProperty(prefix = "thread-pool", name = "enabled", havingValue = "true")
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setMaxPoolSize(core);
executor.setCorePoolSize(core * 2);
executor.setMaxPoolSize(core * 2);
executor.setCorePoolSize(core);
executor.setQueueCapacity(threadPoolProperties.getQueueCapacity());
executor.setKeepAliveSeconds(threadPoolProperties.getKeepAliveSeconds());
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());