bullmq icon indicating copy to clipboard operation
bullmq copied to clipboard

Ability to reset attempts of a job

Open rileyai-dev opened this issue 2 years ago • 5 comments

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

rileyai-dev avatar Aug 24 '23 10:08 rileyai-dev

hey @rileyai-dev, I've been thinking about this for a while, let me see if I can work on one option for this

roggervalf avatar Sep 30 '23 05:09 roggervalf

Cool, that would be great! In the meantime, we have implemented two queues, with one posting to the other with a delay.

rileyai-dev avatar Oct 02 '23 07:10 rileyai-dev

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.

juhanakristian avatar Nov 28 '23 08:11 juhanakristian

I hope v5 resolves this issue for you (https://bullmq.io/news/231221/bullmqv5-release/), let me know.

manast avatar Dec 22 '23 10:12 manast