Is there a way to access a Job associated with a girder-worker task from within that task? Specifically, I’d like to update Job’s progress message.
I think if your task is a bound task, then it should have access to a couple of things:
- An instance of Girder Client, using the
girder_clientattribute of your bound task (
self.girder_client). This may or may not be authenticated already.
- An instance of a JobManager, which has methods for updating progress (
A quick code example of what @danlamanna was referring to:
from girder_worker.app import app @app.task(bind=True) def my_task(self, *args, **kwargs): self.job_manager.updateProgress(message='starting', total=100, current=0) # do stuff
Thanks a lot!