diff --git a/common/src/main/java/ctbrec/recorder/SimplifiedLocalRecorder.java b/common/src/main/java/ctbrec/recorder/SimplifiedLocalRecorder.java index 52e80cfc..a2b60574 100644 --- a/common/src/main/java/ctbrec/recorder/SimplifiedLocalRecorder.java +++ b/common/src/main/java/ctbrec/recorder/SimplifiedLocalRecorder.java @@ -35,6 +35,7 @@ import static ctbrec.SubsequentAction.*; import static ctbrec.event.Event.Type.MODEL_ONLINE; import static java.lang.Thread.MAX_PRIORITY; import static java.lang.Thread.MIN_PRIORITY; +import static java.util.concurrent.TimeUnit.SECONDS; @Slf4j public class SimplifiedLocalRecorder implements Recorder { @@ -56,7 +57,7 @@ public class SimplifiedLocalRecorder implements Recorder { // thread pools for downloads and post-processing private final ScheduledExecutorService scheduler; 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 ThreadPoolScaler threadPoolScaler; private long lastSpaceCheck;