mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
fix: 设置线程池并发数量,防止抢占过多系统资源
This commit is contained in:
@@ -15,6 +15,8 @@ public class CommonThreadPool {
|
||||
|
||||
private int maxQueueSize = 10;
|
||||
|
||||
private int maximumPoolSize = 10;
|
||||
|
||||
private int keepAliveSeconds = 600;
|
||||
|
||||
private ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
|
||||
@@ -22,6 +24,7 @@ public class CommonThreadPool {
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(corePoolSize);
|
||||
scheduledThreadPoolExecutor.setMaximumPoolSize(maximumPoolSize);
|
||||
scheduledThreadPoolExecutor.setKeepAliveTime(keepAliveSeconds, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user