From 9bb4dc3ab0a00c9d9df26390413f3a52b1071a94 Mon Sep 17 00:00:00 2001 From: Vito0912 <86927734+Vito0912@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:58:44 +0200 Subject: [PATCH 1/2] potential fix --- server/managers/PodcastManager.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/managers/PodcastManager.js b/server/managers/PodcastManager.js index 052ba8b3..bb4a408c 100644 --- a/server/managers/PodcastManager.js +++ b/server/managers/PodcastManager.js @@ -384,7 +384,13 @@ class PodcastManager { Logger.error(`[PodcastManager] checkPodcastForNewEpisodes no feed url for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id})`) return null } - const feed = await getPodcastFeed(podcastLibraryItem.media.feedURL) + const feed = await Promise.race([ + getPodcastFeed(podcastLibraryItem.media.feedURL), + new Promise((_, reject) => + // The added second is to make sure that axios can fail first and only falls back later + setTimeout(() => reject(new Error('Timeout. getPodcastFeed seemed to timeout but not triggering the timeout.')), global.PodcastDownloadTimeout + 1000) + ) + ]) if (!feed?.episodes) { Logger.error(`[PodcastManager] checkPodcastForNewEpisodes invalid feed payload for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id})`, feed) return null From 357176b301551b8c2551b94f41be87c28df3e950 Mon Sep 17 00:00:00 2001 From: Vito0912 <86927734+Vito0912@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:15:18 +0200 Subject: [PATCH 2/2] catch timeout --- server/managers/PodcastManager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/managers/PodcastManager.js b/server/managers/PodcastManager.js index bb4a408c..625688c9 100644 --- a/server/managers/PodcastManager.js +++ b/server/managers/PodcastManager.js @@ -390,7 +390,11 @@ class PodcastManager { // The added second is to make sure that axios can fail first and only falls back later setTimeout(() => reject(new Error('Timeout. getPodcastFeed seemed to timeout but not triggering the timeout.')), global.PodcastDownloadTimeout + 1000) ) - ]) + ]).catch((error) => { + Logger.error(`[PodcastManager] checkPodcastForNewEpisodes failed to fetch feed for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id}):`, error) + return null + }) + if (!feed?.episodes) { Logger.error(`[PodcastManager] checkPodcastForNewEpisodes invalid feed payload for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id})`, feed) return null