Failed Attempt event
Created by: cpitt
While I find Bull to be a great improvement over Kue, one thing that I find myself missing from Kue is the differentiation of failed
and failed attempt
events. Currently my workaround is:
myQueue
.on('failed',
(queueJob, error) => {
const {attempts, attemptsMade} = queueJob;
if (attempts === attemptsMade) {
doSomethingForFailure();
} else {
doSomethingElseForAttempt();
}
}
I realize that having different events for failed
and failed attempt
would be a breaking change and would need to wait until the next minor or even major release, but in the mean time it might be worth documenting the above work around (or another if there is a better way of achieving this) for others coming from Kue who might require this functionality.
I'd be more than happy to create a PRs if this request seems reasonable and inline with your project.