1
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.jarvis.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Configuration
|
||||
public class GoofishAsyncConfig {
|
||||
|
||||
@Bean("goofishTaskExecutor")
|
||||
public Executor goofishTaskExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(2);
|
||||
executor.setMaxPoolSize(8);
|
||||
executor.setQueueCapacity(500);
|
||||
executor.setThreadNamePrefix("goofish-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user