mirror of
https://github.com/sismics/docs.git
synced 2024-12-22 11:23:48 +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()) {
|
||||
return new EventBus();
|
||||
} else {
|
||||
int threadCount = Runtime.getRuntime().availableProcessors() / 2;
|
||||
int threadCount = Math.max(Runtime.getRuntime().availableProcessors() / 2, 2);
|
||||
ThreadPoolExecutor executor = new ThreadPoolExecutor(threadCount, threadCount,
|
||||
1L, TimeUnit.MINUTES,
|
||||
new LinkedBlockingQueue<>());
|
||||
|
Loading…
Reference in New Issue
Block a user