getJobs() start and end options are applied per job state
Created by: soulchild
Don't know if this is intended behaviour, but I noticed that when using getJobs()
with multiple states, the optional start
and end
parameters to skip/limit the results seem applied per job state. So, given this:
getJobs(['active', 'completed'], 0, 1)
and having, say 10 active and 10 completed jobs in the queue, the call yields 4 jobs: The first 2 jobs with state active
, and the first two jobs with state completed
. I'd have expected to just get two results.
If this is indeed intended, I suggest updating the reference manual to point this out, because it took me some time to figure out what's going on there.