|
|
@@ -10,6 +10,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
|
|
|
|
import java.util.concurrent.Executor;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
@@ -102,7 +103,7 @@ public class ThreadPoolConfig
|
|
|
}
|
|
|
|
|
|
@Bean(name = "sopRatingExecutor")
|
|
|
- public Executor sopRatingExecutor() {
|
|
|
+ public ExecutorService sopRatingExecutor() {
|
|
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
|
|
executor.setCorePoolSize(16); // 根据需求调整
|
|
|
executor.setMaxPoolSize(32); // 根据需求调整
|
|
|
@@ -110,6 +111,6 @@ public class ThreadPoolConfig
|
|
|
executor.setThreadNamePrefix("SopRating-");
|
|
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
|
|
executor.initialize();
|
|
|
- return executor;
|
|
|
+ return executor.getThreadPoolExecutor();
|
|
|
}
|
|
|
}
|