-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(retry): add stop retrying jobs pattern #2080
Conversation
const [isRateLimited, duration] = await doExternalCall(); | ||
if (isRateLimited) { | ||
await worker.rateLimit(duration); | ||
if (job.attemptsMade >= job.opts.attempts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we do this check before await worker.rateLimit(duration)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, but it's better to set the queue in rate limit before so other jobs after this one will not be picked
queueName, | ||
async job => { | ||
await worker.rateLimit(dynamicLimit); | ||
if (job.attemptsMade >= job.opts.attempts!) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
ref #1571