Resolves null when the first read returns nothing. That is "unknown", not
"failed": some jobs are complete the moment they exist and never publish a
readable status, so treating null as an error would reject work that already
succeeded. A short pause before returning gives such a job a beat to settle.
Reads a job's state until it stops being pending.
Resolves
nullwhen the first read returns nothing. That is "unknown", not "failed": some jobs are complete the moment they exist and never publish a readable status, so treatingnullas an error would reject work that already succeeded. A short pause before returning gives such a job a beat to settle.