Builtin backoff strategies "fixed" and "exponential" are mentioned in the docs but not explained, what those strategies are doing ? Can it be combined with attempts option ?
Thanks
yes attempts can be used with backoff strategies.
Builtin backoff strategies "fixed" and "exponential" are mentioned in the docs but not explained, what those strategies are doing ?
Trying to figure out too how backoff's work. They do not seem to do anything.
The code below just does two attempts right after each other. No backoff.
queue.add({ data }, {
timeout: 10000,
attempts: 2,
removeOnComplete: true,
removeOnFail: true,
backoff: {
type: 'fixed',
delay: 5000 // ms
}
})
Until the documentation is up to date I recommend you to check the tests for reference: https://github.com/taskforcesh/bullmq/blob/master/src/test/test_worker.ts#L1058
@tnolet I currently use fixed backoff with delay in production and it works well:
queue.add({ data }, {
attempts: 5,
backoff: {
type: 'fixed',
delay: 30000, // 30s
}
})
5 attempts with 30sec between each try. I still don't know what's the difference between fixed and exponential tho.
Suppose your worker throws error, and the job fails, does removeOnFail: false, keep the job in the queue?
I have
queue.add({ data }, {
removeOnComplete: true,
removeOnFail: false,
})
It removes the jobs whatsoever.
@mythio please do not ask unrelated questions in the issues. You have already asked the same thing in three different places.