actually set a capacity limit to the queue

This commit is contained in:
Athou
2013-05-23 12:08:16 +02:00
parent 9ee2667728
commit 0d65471c83

View File

@@ -59,7 +59,8 @@ public class FeedRefreshUpdater {
int threads = Math.max(settings.getDatabaseUpdateThreads(), 1);
log.info("Creating database pool with {} threads", threads);
pool = new ThreadPoolExecutor(threads, threads, 0,
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(
100 * threads));
pool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy() {
@Override
public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {