This commit is contained in:
cc
2024-11-29 14:11:49 +08:00
parent cd8dd2ee4a
commit 3dfc6f0b3d
2 changed files with 3 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package cn.van.business.config;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
@@ -20,7 +21,7 @@ import java.util.concurrent.ThreadPoolExecutor;
@EnableAsync
public class AsyncConfig implements AsyncConfigurer {
@Override
@Bean(name = "threadPoolTaskExecutor")
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10); // 核心线程数