mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #3502 from omnivore-app/fix/bullmq-job-retry-backoff
increase the seed valud of backoff delay to 2 seconds
This commit is contained in:
commit
468f835f9e
3 changed files with 12 additions and 16 deletions
|
|
@ -137,8 +137,6 @@ export const queueRSSRefreshFeedJob = async (
|
|||
}
|
||||
return queue.add('refresh-feed', payload, {
|
||||
jobId: jobid,
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true,
|
||||
priority: options.priority == 'low' ? 10 : 50,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,18 @@ export const getBackendQueue = async (): Promise<Queue | undefined> => {
|
|||
}
|
||||
backendQueue = new Queue(QUEUE_NAME, {
|
||||
connection: redisDataSource.workerRedisClient,
|
||||
defaultJobOptions: {
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 2000, // 2 seconds
|
||||
},
|
||||
removeOnComplete: {
|
||||
age: 24 * 3600, // keep up to 24 hours
|
||||
},
|
||||
removeOnFail: {
|
||||
age: 7 * 24 * 3600, // keep up to 7 days
|
||||
},
|
||||
},
|
||||
})
|
||||
await backendQueue.waitUntilReady()
|
||||
return backendQueue
|
||||
|
|
|
|||
|
|
@ -666,8 +666,6 @@ export const enqueueTriggerRuleJob = async (data: TriggerRuleJobData) => {
|
|||
return queue.add(TRIGGER_RULE_JOB_NAME, data, {
|
||||
priority: 5,
|
||||
attempts: 1,
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -680,8 +678,6 @@ export const enqueueWebhookJob = async (data: CallWebhookJobData) => {
|
|||
return queue.add(CALL_WEBHOOK_JOB_NAME, data, {
|
||||
priority: 5,
|
||||
attempts: 1,
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -698,10 +694,6 @@ export const bulkEnqueueUpdateLabels = async (data: UpdateLabelsData[]) => {
|
|||
jobId: `${UPDATE_LABELS_JOB}_${d.libraryItemId}`,
|
||||
attempts: 6,
|
||||
priority: 1,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 1000,
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
|
|
@ -724,10 +716,6 @@ export const enqueueUpdateHighlight = async (data: UpdateHighlightData) => {
|
|||
jobId: `${UPDATE_HIGHLIGHT_JOB}_${data.libraryItemId}`,
|
||||
attempts: 6,
|
||||
priority: 1,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 1000,
|
||||
},
|
||||
})
|
||||
} catch (error) {
|
||||
logger.error('error enqueuing update highlight job', error)
|
||||
|
|
@ -747,8 +735,6 @@ export const enqueueBulkAction = async (data: BulkActionData) => {
|
|||
attempts: 1,
|
||||
priority: 10,
|
||||
jobId, // deduplication
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true,
|
||||
})
|
||||
} catch (error) {
|
||||
logger.error('error enqueuing bulk action job', error)
|
||||
|
|
|
|||
Loading…
Reference in a new issue