Update:Only load feeds when needed

This commit is contained in:
advplyr 2023-07-17 16:48:46 -05:00
parent 20c11e381e
commit 6814adffcc
10 changed files with 125 additions and 55 deletions

View file

@ -30,7 +30,7 @@ class RSSFeedController {
}
// Check that this slug is not being used for another feed (slug will also be the Feed id)
if (this.rssFeedManager.findFeedBySlug(options.slug)) {
if (await this.rssFeedManager.findFeedBySlug(options.slug)) {
Logger.error(`[RSSFeedController] Cannot open RSS feed because slug "${options.slug}" is already in use`)
return res.status(400).send('Slug already in use')
}
@ -55,7 +55,7 @@ class RSSFeedController {
}
// Check that this slug is not being used for another feed (slug will also be the Feed id)
if (this.rssFeedManager.findFeedBySlug(options.slug)) {
if (await this.rssFeedManager.findFeedBySlug(options.slug)) {
Logger.error(`[RSSFeedController] Cannot open RSS feed because slug "${options.slug}" is already in use`)
return res.status(400).send('Slug already in use')
}
@ -89,7 +89,7 @@ class RSSFeedController {
}
// Check that this slug is not being used for another feed (slug will also be the Feed id)
if (this.rssFeedManager.findFeedBySlug(options.slug)) {
if (await this.rssFeedManager.findFeedBySlug(options.slug)) {
Logger.error(`[RSSFeedController] Cannot open RSS feed because slug "${options.slug}" is already in use`)
return res.status(400).send('Slug already in use')
}