It would be great to have the ability to get a Job's status (completed, failed, delayed... etc).
We have a scenario where we would like to write custom logic depending on the job's status. The existing API to return all of the jobs that fall under a specific status isn't really fitting for our case scenario.
Is there any plans for adding this functionality?
Thanks!
Not in the short term. That functionality does not fit so well in the current design, it would require an extra status variable that needs to be updated atomically when moving the job from state to state. Maybe if you explain what you are tying to achieve I can find a different path.
I actually found a getState method on the Job object that returns a Promise with the Job's state. This is exactly what we needed but it is not currently documented.
Now, after reading your reply, did you understand something different?
Were you maybe referring to a string property on the Job object instead of the existing Promise-returning method? Just wanted to clarify.
Thanks.
No I did not, but we get a lot of patches and sometimes I forget that we already have some functions. However, this implementation is not very high performant, nor atomic, but as long as your queue does not have a very large amount of items I guess it is ok.
Most helpful comment
No I did not, but we get a lot of patches and sometimes I forget that we already have some functions. However, this implementation is not very high performant, nor atomic, but as long as your queue does not have a very large amount of items I guess it is ok.