mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
set a minimum for threadpool size
This commit is contained in:
@@ -83,7 +83,7 @@ public class StartupBean {
|
||||
int threads = settings.getBackgroundThreads();
|
||||
log.info("Starting {} background threads", threads);
|
||||
|
||||
executor = Executors.newFixedThreadPool(threads);
|
||||
executor = Executors.newFixedThreadPool(Math.max(threads, 1));
|
||||
for (int i = 0; i < threads; i++) {
|
||||
final int threadId = i;
|
||||
executor.execute(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user