bullmq
bullmq copied to clipboard
Ability to reset attempts of a job
Is your feature request related to a problem? Please describe. We use a mechanism (moveToDelay) to restart a job with a delay right after it was successfully performed. We can't use cron jobs because the delay is picked randomly. We can't either create a new job because we want to be sure we keep the unicity of the jobID (make sure there are no duplicates). The problem we have is that each time we moveToDelay, we would like the attempts made and stalled counters to be reseted.
Describe the solution you'd like Functions to manually reset the attempts made and the stalled counters of a job.
Describe alternatives you've considered An alternative in our case would be to create two different queues. Once the job is complete (queue A), post to the other queue (queue B) with 2 seconds delay. Job in queue A would complete and job in queue B will be able to re-create a new job in queue A making sure unicity of job is kept. With this solution there might be other challenges to handle...
Additional context None
hey @rileyai-dev, I've been thinking about this for a while, let me see if I can work on one option for this
Cool, that would be great! In the meantime, we have implemented two queues, with one posting to the other with a delay.
I would also be interested in this feature. Currently I'm pausing the queue when a job fails enough times and I would like to restart queue with all the attempt counts reset.
I hope v5 resolves this issue for you (https://bullmq.io/news/231221/bullmqv5-release/), let me know.