Replies: 1 comment 1 reply
-
There are many reasons why your approach won't work, so I will not dig into all the details. However, I can give you a couple of hints, first I will recommend you to use BullMQ instead (newer, more stable, better maintained), and secondly, you should be able to use the standard retry settings for a use case like this, from what you write it seems like a standard retry case with the "removeOnFail" option. https://docs.bullmq.io/guide/workers/auto-removal-of-jobs |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I was dabbling into bull queue because I was going to incorporate it into my project. The scenario in my project is that every job can be retried once (i.e. if it fails a second time, it should be removed from the queue). The job is basically handling some API call to a third party server which may or may not respond always. Which is why I have a setInterval to check if certain time has elapsed since job started processing. I have to fail the job and send it to retry if this is the first attempt otherwise remove it/mark as failed. Below is a minimum test code for the issue I am facing. Basically, moveToFailed function takes the job into waiting state (which doesn't make sense? Should it not move to failed state?) It then retries the job once more after which no other job is being processed.
I have to manually call moveToFailed and/or moveToCompleted because of my desired functionality. If there's something I should do differently please do let me know as it is pretty essential I incorporate this feature.
I am using bull version 4.12.9
Beta Was this translation helpful? Give feedback.
All reactions