Remove download thread pool size settings

ThreadPoolScaler takes care of the correct size. The setting is not
needed anymore
This commit is contained in:
0xb00bface 2021-01-01 16:39:29 +01:00
parent 9dde3fe842
commit e0dbb0eea7
3 changed files with 3 additions and 11 deletions

View File

@ -96,7 +96,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
private SimpleFileProperty mediaPlayer; private SimpleFileProperty mediaPlayer;
private SimpleStringProperty mediaPlayerParams; private SimpleStringProperty mediaPlayerParams;
private SimpleIntegerProperty maximumResolutionPlayer; private SimpleIntegerProperty maximumResolutionPlayer;
private SimpleIntegerProperty recorderThreadPoolSize;
private SimpleBooleanProperty showPlayerStarting; private SimpleBooleanProperty showPlayerStarting;
private SimpleBooleanProperty singlePlayer; private SimpleBooleanProperty singlePlayer;
private SimpleListProperty<ProxyType> proxyType; private SimpleListProperty<ProxyType> proxyType;
@ -183,7 +182,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
onlineCheckSkipsPausedModels = new SimpleBooleanProperty(null, "onlineCheckSkipsPausedModels", settings.onlineCheckSkipsPausedModels); onlineCheckSkipsPausedModels = new SimpleBooleanProperty(null, "onlineCheckSkipsPausedModels", settings.onlineCheckSkipsPausedModels);
fastScrollSpeed = new SimpleBooleanProperty(null, "fastScrollSpeed", settings.fastScrollSpeed); fastScrollSpeed = new SimpleBooleanProperty(null, "fastScrollSpeed", settings.fastScrollSpeed);
confirmationDialogs = new SimpleBooleanProperty(null, "confirmationForDangerousActions", settings.confirmationForDangerousActions); confirmationDialogs = new SimpleBooleanProperty(null, "confirmationForDangerousActions", settings.confirmationForDangerousActions);
recorderThreadPoolSize = new SimpleIntegerProperty(null, "downloadThreadPoolSize", settings.downloadThreadPoolSize);
} }
private void createGui() { private void createGui() {
@ -267,9 +265,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
), ),
Category.of("Advanced / Devtools", Category.of("Advanced / Devtools",
Group.of("Logging", Group.of("Logging",
Setting.of("Log FFmpeg output", logFFmpegOutput, "Log FFmpeg output to files in the system's temp directory"), Setting.of("Log FFmpeg output", logFFmpegOutput, "Log FFmpeg output to files in the system's temp directory")
Setting.of("Recorder thread pool size", recorderThreadPoolSize,
"Number of threads used for the downloads. More = less missed segments for large amounts of concurrent recordings, but more resource hungry").needsRestart()
) )
) )
); );
@ -301,7 +297,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
setContent(stackPane); setContent(stackPane);
prefs.expandTree(); prefs.expandTree();
prefs.getSetting("httpServer").ifPresent(s -> bindEnabledProperty(s, recordLocal)); prefs.getSetting("httpServer").ifPresent(s -> bindEnabledProperty(s, recordLocal));
prefs.getSetting("httpPort").ifPresent(s -> bindEnabledProperty(s, recordLocal)); prefs.getSetting("httpPort").ifPresent(s -> bindEnabledProperty(s, recordLocal));
prefs.getSetting("servletContext").ifPresent(s -> bindEnabledProperty(s, recordLocal)); prefs.getSetting("servletContext").ifPresent(s -> bindEnabledProperty(s, recordLocal));
@ -324,8 +319,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
prefs.getSetting("downloadFilename").ifPresent(s -> bindEnabledProperty(s, recordLocal)); prefs.getSetting("downloadFilename").ifPresent(s -> bindEnabledProperty(s, recordLocal));
postProcessingStepPanel.disableProperty().bind(recordLocal.not()); postProcessingStepPanel.disableProperty().bind(recordLocal.not());
variablesHelpButton.disableProperty().bind(recordLocal); variablesHelpButton.disableProperty().bind(recordLocal);
} }
private void splitValuesChanged(ObservableValue<?> value, Object oldV, Object newV) { private void splitValuesChanged(ObservableValue<?> value, Object oldV, Object newV) {

View File

@ -59,7 +59,6 @@ public class Settings {
public boolean determineResolution = false; public boolean determineResolution = false;
public List<String> disabledSites = new ArrayList<>(); public List<String> disabledSites = new ArrayList<>();
public String downloadFilename = "${modelSanitizedName}-${localDateTime}"; public String downloadFilename = "${modelSanitizedName}-${localDateTime}";
public int downloadThreadPoolSize = 20;
public List<EventHandlerConfiguration> eventHandlers = new ArrayList<>(); public List<EventHandlerConfiguration> eventHandlers = new ArrayList<>();
public boolean fastPlaylistGenerator = false; public boolean fastPlaylistGenerator = false;
public boolean fastScrollSpeed = true; public boolean fastScrollSpeed = true;

View File

@ -86,8 +86,8 @@ public class NextGenLocalRecorder implements Recorder {
public NextGenLocalRecorder(Config config, List<Site> sites) throws IOException { public NextGenLocalRecorder(Config config, List<Site> sites) throws IOException {
this.config = config; this.config = config;
downloadPool = Executors.newScheduledThreadPool(config.getSettings().downloadThreadPoolSize, createThreadFactory("Download", MAX_PRIORITY)); downloadPool = Executors.newScheduledThreadPool(5, createThreadFactory("Download", MAX_PRIORITY));
threadPoolScaler = new ThreadPoolScaler((ThreadPoolExecutor) downloadPool, config.getSettings().downloadThreadPoolSize); threadPoolScaler = new ThreadPoolScaler((ThreadPoolExecutor) downloadPool, 5);
recordingManager = new RecordingManager(config, sites); recordingManager = new RecordingManager(config, sites);
config.getSettings().models.stream().forEach(m -> { config.getSettings().models.stream().forEach(m -> {
if (m.getSite() != null) { if (m.getSite() != null) {