forked from github/dataease
fix: 设置线程池并发数量,防止抢占过多系统资源
This commit is contained in:
parent
39e267fc2d
commit
0e46b48420
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user