feat: enhance price update job handling with deduplication and retry logic
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m20s
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m20s
This commit is contained in:
+7
-1
@@ -218,7 +218,13 @@ const schedulerWorker = new Worker(
|
||||
await priceUpdateQueue.add(
|
||||
'update-price',
|
||||
{ hashtagId: hashtag.id, tag: hashtag.tag },
|
||||
{ jobId: `price-${hashtag.id}` }, // deduplicate by jobId
|
||||
{
|
||||
jobId: `price-${hashtag.id}`, // deduplicates against waiting/active (hash persists)
|
||||
removeOnComplete: true, // remove hash on completion so jobId can be reused next sweep
|
||||
removeOnFail: { count: 50 },
|
||||
attempts: 3,
|
||||
backoff: { type: 'exponential', delay: 5000 },
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user