max rss feed defaults to 256

This commit is contained in:
Hongbo Wu
2023-12-11 13:18:43 +08:00
parent b135dfbc46
commit 36896a8770
2 changed files with 6 additions and 4 deletions

View File

@ -223,7 +223,7 @@ export const subscribeResolver = authorized<
}
// create new rss subscription
const MAX_RSS_SUBSCRIPTIONS = 150
const MAX_RSS_SUBSCRIPTIONS = env.subscription.feed.max
// validate rss feed
const feed = await parseFeed(input.url)
if (!feed) {
@ -232,7 +232,7 @@ export const subscribeResolver = authorized<
}
}
// limit number of rss subscriptions to 150
// limit number of rss subscriptions to max
const results = (await getRepository(Subscription).query(
`insert into omnivore.subscriptions (name, url, description, type, user_id, icon, auto_add_to_library, is_private)
select $1, $2, $3, $4, $5, $6, $7, $8 from omnivore.subscriptions
@ -263,7 +263,7 @@ export const subscribeResolver = authorized<
// create a cloud task to fetch rss feed item for the new subscription
await enqueueRssFeedFetch({
userIds: [uid],
url: input.url,
url: feed.url,
subscriptionIds: [newSubscription.id],
scheduledDates: [new Date()], // fetch immediately
fetchedDates: [null],