Bull: Ability to get a job's status

Created on 10 Oct 2017  路  3Comments  路  Source: OptimalBits/bull

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!

BETTER DOC enhancement help wanted

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rodrigoords picture rodrigoords  路  4Comments

Jujunol picture Jujunol  路  4Comments

joe-at-startupmedia picture joe-at-startupmedia  路  3Comments

PhillippOhlandt picture PhillippOhlandt  路  4Comments

ianstormtaylor picture ianstormtaylor  路  4Comments