Move the rss content block check to the rss handler

This commit is contained in:
Jackson Harper 2023-12-29 12:42:43 +08:00
parent c9b93a1180
commit 816416934f

View file

@ -462,10 +462,6 @@ const processSubscription = async (
continue
}
if (isContentFetchBlocked(feedUrl)) {
fetchContent = false
}
const created = await createTask(
userId,
feedUrl,
@ -559,6 +555,12 @@ export const rssHandler = Sentry.GCPFunction.wrapHttpFunction(
return res.status(500).send('INVALID_RSS_FEED')
}
let allowFetchContent = true
if (isContentFetchBlocked(feedUrl)) {
console.log('fetching content blocked for feed: ', feedUrl)
allowFetchContent = false
}
console.log('Fetched feed', feed.title, new Date())
await Promise.all(
@ -571,7 +573,7 @@ export const rssHandler = Sentry.GCPFunction.wrapHttpFunction(
lastFetchedTimestamps[i],
scheduledTimestamps[i],
lastFetchedChecksums[i],
fetchContents[i],
fetchContents[i] && allowFetchContent,
folders[i],
feed
)