From 84c9c6cb50d6e4a725d0de6c6cba2449e50eab88 Mon Sep 17 00:00:00 2001 From: Vito0912 <86927734+Vito0912@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:07:35 +0200 Subject: [PATCH] move to global --- server/Server.js | 6 ++++++ server/managers/PodcastManager.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/Server.js b/server/Server.js index 17c959c0..317dab38 100644 --- a/server/Server.js +++ b/server/Server.js @@ -91,6 +91,12 @@ class Server { global.PodcastDownloadTimeout = 30000 } + if (process.env.MAX_FAILED_EPISODE_CHECKS) { + global.MaxFailedEpisodeChecks = process.env.MAX_FAILED_EPISODE_CHECKS + } else { + global.MaxFailedEpisodeChecks = 24 + } + if (!fs.pathExistsSync(global.ConfigPath)) { fs.mkdirSync(global.ConfigPath) } diff --git a/server/managers/PodcastManager.js b/server/managers/PodcastManager.js index 54ce4c9f..0c7da925 100644 --- a/server/managers/PodcastManager.js +++ b/server/managers/PodcastManager.js @@ -30,7 +30,7 @@ class PodcastManager { this.currentDownload = null this.failedCheckMap = {} - this.MaxFailedEpisodeChecks = parseInt(process.env.MAX_FAILED_EPISODE_CHECKS, 10) || 24 + this.MaxFailedEpisodeChecks = global.MaxFailedEpisodeChecks } getEpisodeDownloadsInQueue(libraryItemId) {