fix(blacklist): only remove keywords on 404 errors
This commit is contained in:
@@ -91,12 +91,21 @@ class BlacklistedTagProcessor implements RunnableScanner<StatusBase> {
|
|||||||
try {
|
try {
|
||||||
await tmdb.getKeywordDetails({ keywordId: Number(tag) });
|
await tmdb.getKeywordDetails({ keywordId: Number(tag) });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.warn('Skipping invalid keyword in blacklisted tags', {
|
if (error.response?.status === 404) {
|
||||||
label: 'Blacklisted Tags Processor',
|
logger.warn('Skipping invalid keyword in blacklisted tags', {
|
||||||
keywordId: tag,
|
label: 'Blacklisted Tags Processor',
|
||||||
});
|
keywordId: tag,
|
||||||
invalidKeywords.add(tag);
|
});
|
||||||
continue;
|
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;
|
let queryMax = pageLimit * SortOptionsIterable.length;
|
||||||
|
|||||||
Reference in New Issue
Block a user