-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Removing completed jobs automatically & atomically #354
Comments
do you have any chance to test with master to see if it works better with the distributed events? |
Not yet. Will test though. I think we should internalize removal through a new |
bradvogel
added a commit
to mixmaxhq/bull
that referenced
this issue
Oct 15, 2016
…is completed (useful for high-volume queues). Fixes OptimalBits#354
duyenddd
added a commit
to duyenddd/bull
that referenced
this issue
Jul 28, 2024
…is completed (useful for high-volume queues). Fixes OptimalBits/bull#354
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's our desire to remove jobs automatically upon completion. My understanding of the Bull API is that we should do this by listening to the
completed
event on the queue and calljob.remove()
, like this:However, we're finding that some completed jobs aren't getting removed. The likely reason for this is that the server is occasionally being killed right after the job is moved to "completed", but before
job.remove()
can be called. Since events are broadcast locally, there is no second server to pick up the message, the job stays around forever. Our current workaround is to run a cron job every hour that callsclean(10 * 1000, 'completed')
on the queue.I wanted to get your thoughts on the following possible approaches to clean up completed jobs:
removeOnCompleted
option to the job and have themoveToCompleted
script atomically remove the job upon completion.The text was updated successfully, but these errors were encountered: