forked from j62/ctbrec
1
0
Fork 0

Reduce core pool size to 0 for the download thread pool

Most of the time only one thread is used, so we can save resources by
reducing the core pool size
This commit is contained in:
0xb00bface 2020-07-16 18:52:34 +02:00
parent 296585463a
commit 3f4973137c
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
protected volatile boolean running = false;
protected Model model = new UnknownModel();
protected transient LinkedBlockingQueue<Runnable> downloadQueue = new LinkedBlockingQueue<>(50);
protected transient ExecutorService downloadThreadPool = new ThreadPoolExecutor(5, 5, 2, TimeUnit.MINUTES, downloadQueue, createThreadFactory());
protected transient ExecutorService downloadThreadPool = new ThreadPoolExecutor(0, 5, 20, TimeUnit.SECONDS, downloadQueue, createThreadFactory());
protected State state = State.UNKNOWN;
private int playlistEmptyCount = 0;