mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Clean up redis code, remove connection close in job
This commit is contained in:
parent
d92ee4bcfe
commit
7a925f3fdc
3 changed files with 3 additions and 10 deletions
|
|
@ -671,13 +671,10 @@ export const _refreshFeed = async (request: RefreshFeedRequest) => {
|
|||
lastFetchedChecksums[i],
|
||||
fetchContents[i] && allowFetchContent,
|
||||
folders[i],
|
||||
feed,
|
||||
redisClient
|
||||
feed
|
||||
)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error while saving RSS feeds', e)
|
||||
} finally {
|
||||
await redisClient.quit()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export function rssFeedRouter() {
|
|||
}
|
||||
|
||||
if (redisDataSource.workerRedisClient) {
|
||||
await queueRSSRefreshAllFeedsJob(redisDataSource.workerRedisClient)
|
||||
await queueRSSRefreshAllFeedsJob()
|
||||
} else {
|
||||
console.log('unable to fetchAll feeds, redis is not configured')
|
||||
return res.status(500).send('Expired')
|
||||
|
|
|
|||
|
|
@ -663,11 +663,7 @@ export const enqueueRssFeedFetch = async (
|
|||
)}_${stringToHash(JSON.stringify(subscriptionGroup.userIds.sort()))}`
|
||||
|
||||
if (redisDataSource.workerRedisClient) {
|
||||
let job = await queueRSSRefreshFeedJob(
|
||||
redisDataSource.workerRedisClient,
|
||||
jobid,
|
||||
payload
|
||||
)
|
||||
let job = await queueRSSRefreshFeedJob(jobid, payload)
|
||||
if (!job || !job.id) {
|
||||
throw 'unable to queue rss-refresh-feed-job, job did not enqueue'
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue