Closed dasdeck closed 6 years ago
The job status can only be "running" once it has been assigned to a worker. The only way the worker can manipulate that status is by calling job.done()
, job.fail()
or job.cancel()
. It is not permitted to manipulate the status directly.
Oh, I may have misunderstood the question. If the status changes outside the job (say to "failed" or "cancelled") the normal way you detect that is by calling job.progress()
and examining the return value.
job.refresh()
should also work, but since you don't show that code I can't say why it might not for you.
One other note: you can't call job.pause()
on a running job. That only works on scheduled jobs to temporarily prevent them from running.
Hey thanks a lot so far! I'll try that out. I'll try the refresh again, and if it still fails, I'll post that example too.
edit: I understand now! The job is only updated within the callback. Very helpful, thank you!
Hi!
I'm trying to get the job status to update in my nodejs client to controll my process based on it.
collection definition
worker script
Cheers!
JM