修改线程池
This commit is contained in:
@@ -25,12 +25,10 @@ public class ExecutorConfig {
|
||||
@Bean("threadPoolTaskExecutor")
|
||||
public ThreadPoolTaskExecutor corpusProcessExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
int corePoolSize = Runtime.getRuntime().availableProcessors() + 2;
|
||||
|
||||
executor.setCorePoolSize(corePoolSize);
|
||||
executor.setMaxPoolSize(maxPoolSize);
|
||||
executor.setQueueCapacity(queueCapacity);
|
||||
executor.setThreadNamePrefix("corpus-process-pool-");
|
||||
executor.setThreadNamePrefix("Thread-process-pool-");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
executor.setKeepAliveSeconds(keepAliveSeconds);
|
||||
executor.initialize();
|
||||
|
||||
Reference in New Issue
Block a user