change the update-db job priority to 5 and use exponential backoff strategy for retrying

This commit is contained in:
Hongbo Wu
2024-02-01 13:14:01 +08:00
parent e13c418389
commit 19fe60d27a

View File

@ -679,7 +679,12 @@ export const bulkEnqueueUpdateLabels = async (data: UpdateLabelsData[]) => {
name: UPDATE_LABELS_JOB,
data: d,
opts: {
priority: 1,
attempts: 3,
priority: 5,
backoff: {
type: 'exponential',
delay: 1000,
},
},
}))
@ -699,7 +704,12 @@ export const enqueueUpdateHighlight = async (data: UpdateHighlightData) => {
try {
return queue.add(UPDATE_HIGHLIGHT_JOB, data, {
priority: 1,
attempts: 3,
priority: 5,
backoff: {
type: 'exponential',
delay: 1000,
},
})
} catch (error) {
logger.error('error enqueuing update highlight job', error)