don't fetch sidebar for multireddit urls
This commit is contained in:
parent
8336a3d424
commit
5e33387e5b
|
@ -2,6 +2,7 @@ module.exports = function() {
|
|||
this.processSubredditSidebar = (subreddit, redis, fetch, RedditAPI) => {
|
||||
return new Promise(resolve => {
|
||||
(async () => {
|
||||
if(subreddit && !subreddit.includes('+')) {
|
||||
let key = `${subreddit}:sidebar`
|
||||
redis.get(key, (error, json) => {
|
||||
if(error) {
|
||||
|
@ -58,6 +59,9 @@ module.exports = function() {
|
|||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
resolve(null)
|
||||
}
|
||||
})()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue