set a minimum for threadpool size

This commit is contained in:
Athou
2013-05-15 15:56:06 +02:00
parent 819f3a3fb0
commit 0876e918dc

View File

@@ -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() {