-
Notifications
You must be signed in to change notification settings - Fork 13
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
Retrieve timed_out jobs in O(1) #21
Comments
Yup, I can see that would be useful. I'll have more of a think about this, as I'd like to improve on monitoring/tracking of jobs (including being able to e.g. find all timed out jobs), which would help here. I've got notes somewhere on a few solutions I was considering (separate queues based on final status as you suggested was one of them, maintaining an index somewhere to allow O(1) retrieval was another), I'll see if I can dig those out sometime. |
This is how I solved it. Note that my branch is not merge-worthy due to my prefacing the key names with the namespace. |
I've noticed however that in addition to simply adding the job id to the
Other concerns:
Example of duplicates:
|
Hello Dave, great tool here. Here is my first issue. Jobs which have timed out, and no longer retried, are moved to the
ended
list. There is no remaining index (redis key) to retrieve jobs which have a) timed out and b) have zero retries left without querying each job with a timed_out status. Ideally it would be nice to achieve this in constant time not order of (n). The solution here would be to add another redis list calledtimed_out
which would allow you to retrieve the jobs which have timed_out. There is thefailed
list but they do not end up there after the retries have been exhausted. Thoughts?The text was updated successfully, but these errors were encountered: