Merge pull request #2654 from omnivore-app/raise-rss-limit

raise rss limit to 150
This commit is contained in:
Hongbo Wu 2023-08-14 22:29:10 +08:00 committed by GitHub
commit d00eafd189
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -247,6 +247,7 @@ export const subscribeResolver = authorized<
// create new rss subscription
if (input.url) {
const MAX_RSS_SUBSCRIPTIONS = 150
// validate rss feed
const feed = await parser.parseURL(input.url)
@ -255,7 +256,7 @@ export const subscribeResolver = authorized<
`insert into omnivore.subscriptions (name, url, description, type, user_id, icon)
select $1, $2, $3, $4, $5, $6 from omnivore.subscriptions
where user_id = $5 and type = 'RSS' and status = 'ACTIVE'
having count(*) < 50
having count(*) < $7
returning *;`,
[
feed.title,
@ -264,6 +265,7 @@ export const subscribeResolver = authorized<
SubscriptionType.Rss,
uid,
feed.image?.url || null,
MAX_RSS_SUBSCRIPTIONS,
]
)) as Subscription[]