forked from j62/ctbrec
fix segment downloads choking
This commit is contained in:
parent
33f99488e2
commit
f7b473e109
|
@ -35,6 +35,7 @@ import static ctbrec.SubsequentAction.*;
|
||||||
import static ctbrec.event.Event.Type.MODEL_ONLINE;
|
import static ctbrec.event.Event.Type.MODEL_ONLINE;
|
||||||
import static java.lang.Thread.MAX_PRIORITY;
|
import static java.lang.Thread.MAX_PRIORITY;
|
||||||
import static java.lang.Thread.MIN_PRIORITY;
|
import static java.lang.Thread.MIN_PRIORITY;
|
||||||
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SimplifiedLocalRecorder implements Recorder {
|
public class SimplifiedLocalRecorder implements Recorder {
|
||||||
|
@ -56,7 +57,7 @@ public class SimplifiedLocalRecorder implements Recorder {
|
||||||
// thread pools for downloads and post-processing
|
// thread pools for downloads and post-processing
|
||||||
private final ScheduledExecutorService scheduler;
|
private final ScheduledExecutorService scheduler;
|
||||||
private final ExecutorService playlistDownloadPool = Executors.newFixedThreadPool(10);
|
private final ExecutorService playlistDownloadPool = Executors.newFixedThreadPool(10);
|
||||||
private final ExecutorService segmentDownloadPool = Executors.newFixedThreadPool(10);
|
private final ExecutorService segmentDownloadPool = new ThreadPoolExecutor(0, 1000, 30L, SECONDS, new SynchronousQueue<>(), createThreadFactory("SegmentDownload", MAX_PRIORITY - 2));
|
||||||
private final ExecutorService postProcessing;
|
private final ExecutorService postProcessing;
|
||||||
private final ThreadPoolScaler threadPoolScaler;
|
private final ThreadPoolScaler threadPoolScaler;
|
||||||
private long lastSpaceCheck;
|
private long lastSpaceCheck;
|
||||||
|
|
Loading…
Reference in New Issue