mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
at least 2 threads for background work
This commit is contained in:
parent
7c72b5e69b
commit
0d058b9c9c
@ -171,7 +171,7 @@ public class AppContext {
|
|||||||
if (EnvironmentUtil.isUnitTest()) {
|
if (EnvironmentUtil.isUnitTest()) {
|
||||||
return new EventBus();
|
return new EventBus();
|
||||||
} else {
|
} else {
|
||||||
int threadCount = Runtime.getRuntime().availableProcessors() / 2;
|
int threadCount = Math.max(Runtime.getRuntime().availableProcessors() / 2, 2);
|
||||||
ThreadPoolExecutor executor = new ThreadPoolExecutor(threadCount, threadCount,
|
ThreadPoolExecutor executor = new ThreadPoolExecutor(threadCount, threadCount,
|
||||||
1L, TimeUnit.MINUTES,
|
1L, TimeUnit.MINUTES,
|
||||||
new LinkedBlockingQueue<>());
|
new LinkedBlockingQueue<>());
|
||||||
|
Loading…
Reference in New Issue
Block a user