increase the seed valud of backoff delay to 2 seconds

This commit is contained in:
Hongbo Wu 2024-02-05 16:26:05 +08:00
parent dde80091b4
commit 53f63b90d7
3 changed files with 8 additions and 16 deletions

View file

@ -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,
})
}

View file

@ -49,6 +49,14 @@ export const getBackendQueue = async (): Promise<Queue | undefined> => {
}
backendQueue = new Queue(QUEUE_NAME, {
connection: redisDataSource.workerRedisClient,
defaultJobOptions: {
backoff: {
type: 'exponential',
delay: 2000, // 2 seconds
},
removeOnComplete: true,
removeOnFail: true,
},
})
await backendQueue.waitUntilReady()
return backendQueue

View file

@ -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,
})
}
@ -697,10 +693,6 @@ export const bulkEnqueueUpdateLabels = async (data: UpdateLabelsData[]) => {
opts: {
attempts: 3,
priority: 1,
backoff: {
type: 'exponential',
delay: 1000,
},
},
}))
@ -722,10 +714,6 @@ export const enqueueUpdateHighlight = async (data: UpdateHighlightData) => {
return queue.add(UPDATE_HIGHLIGHT_JOB, data, {
attempts: 3,
priority: 1,
backoff: {
type: 'exponential',
delay: 1000,
},
})
} catch (error) {
logger.error('error enqueuing update highlight job', error)
@ -745,8 +733,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)