From 5ed4e0c7148f111a2af806fd884b9c7c9ec61261 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <0xsysr3ll@pm.me> Date: Tue, 29 Jul 2025 00:07:26 +0200 Subject: [PATCH] fix(blacklist): only remove keywords on 404 errors --- server/job/blacklistedTagsProcessor.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/server/job/blacklistedTagsProcessor.ts b/server/job/blacklistedTagsProcessor.ts index 775cecce..d35caa1b 100644 --- a/server/job/blacklistedTagsProcessor.ts +++ b/server/job/blacklistedTagsProcessor.ts @@ -91,12 +91,21 @@ class BlacklistedTagProcessor implements RunnableScanner { try { await tmdb.getKeywordDetails({ keywordId: Number(tag) }); } catch (error) { - logger.warn('Skipping invalid keyword in blacklisted tags', { - label: 'Blacklisted Tags Processor', - keywordId: tag, - }); - invalidKeywords.add(tag); - continue; + if (error.response?.status === 404) { + logger.warn('Skipping invalid keyword in blacklisted tags', { + label: 'Blacklisted Tags Processor', + keywordId: tag, + }); + invalidKeywords.add(tag); + continue; + } else { + // Might be temporary service issues so do nothing + logger.error('Error checking keyword validity', { + label: 'Blacklisted Tags Processor', + keywordId: tag, + errorMessage: error.message, + }); + } } let queryMax = pageLimit * SortOptionsIterable.length;