forked from Archives/Athou_commafeed
set a minimum for threadpool size
This commit is contained in:
@@ -83,7 +83,7 @@ public class StartupBean {
|
|||||||
int threads = settings.getBackgroundThreads();
|
int threads = settings.getBackgroundThreads();
|
||||||
log.info("Starting {} background threads", threads);
|
log.info("Starting {} background threads", threads);
|
||||||
|
|
||||||
executor = Executors.newFixedThreadPool(threads);
|
executor = Executors.newFixedThreadPool(Math.max(threads, 1));
|
||||||
for (int i = 0; i < threads; i++) {
|
for (int i = 0; i < threads; i++) {
|
||||||
final int threadId = i;
|
final int threadId = i;
|
||||||
executor.execute(new Runnable() {
|
executor.execute(new Runnable() {
|
||||||
|
|||||||
Reference in New Issue
Block a user