mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-23 16:05:09 +00:00
24 lines
733 B
Java
24 lines
733 B
Java
package stirling.software.proprietary.config;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
|
import java.util.concurrent.Executor;
|
|
|
|
@Configuration
|
|
@EnableAsync
|
|
public class AsyncConfig {
|
|
|
|
@Bean(name = "auditExecutor")
|
|
public Executor auditExecutor() {
|
|
ThreadPoolTaskExecutor exec = new ThreadPoolTaskExecutor();
|
|
exec.setCorePoolSize(2);
|
|
exec.setMaxPoolSize(8);
|
|
exec.setQueueCapacity(1_000);
|
|
exec.setThreadNamePrefix("audit-");
|
|
exec.initialize();
|
|
return exec;
|
|
}
|
|
} |