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
Not remove failed jobs from queue #230
Comments
@manast Can you please tell if this is broken? Works as expected in bull, but not in bullmq |
What do you mean with "remove from queue" to begin with? Explain what is the behaviour you expect with code please. |
Okay, so in producer, I am adding some data to the queue 15 times only.
And in consumer, I am throwing error for each job,
Now as expected, all the jobs are failing, and when I call |
In the code above you are calling getFailedCount and getFailed before the workers had a chance to process the jobs. |
Yes you are right, but I call the producer again, and at time I get the failed jobs from the previous time |
send a code snippet that precisely reproduces what you mean |
Actually I am using producer-consumer design. There are 2 routes, one for producer to add data to queue. It adds 15 items to the queue and returns. Another route for consumer, it asynchronously calls the worker, to process only 20 items from the queue, and then close the worker. Here is what I am expecting...
But what I see is...
As you can see, |
The code above does not reproduce an issue. You need to be able to write a code snippet as a test case, where something does not work as expected. I would like to help you, but really I can't if you do not provide the code. |
I dont want to remove the failed jobs from the queue, Instead let the user process it later. I have tried to set
defaultJobOptions.removeOnFail
to false, still it is removed from the queue. I could not find anything regarding this in the docs either.The logs print that the job failed as
true
still they are removed from queueThe text was updated successfully, but these errors were encountered: