线程池直接拉大

This commit is contained in:
2025-03-02 23:25:37 +08:00
parent 519f9969ec
commit e9890a3856
7 changed files with 50 additions and 18 deletions

View File

@@ -0,0 +1,19 @@
package com.ycwl.basic.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
@Configuration
@EnableScheduling
public class SchedulerConfig {
@Bean
public ThreadPoolTaskScheduler taskScheduler() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(256);
scheduler.setThreadNamePrefix("Scheduler-");
return scheduler;
}
}