mirror of
https://github.com/sismics/docs.git
synced 2025-12-13 01:36:18 +00:00
at least 2 threads for background work
This commit is contained in:
@@ -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<>());
|
||||||
|
|||||||
Reference in New Issue
Block a user