Hello,
Is there a way to access the current task ID when using something like an OnSlaveRendering callback? Since it’s the workername and job passed to the event I tried something like:
def OnSlaveRendering( self, workername, job):
self.LogInfo("OnSlaveRendering Begin")
workerinfo = RepositoryUtils.GetSlaveInfo(workername, True)
taskId = workerinfo.SlaveCurrentTaskIds
name = workerinfo.SlaveName
self.LogInfo(f"Worker Name is: {name}")
self.LogInfo(f"Current TaskID is: {list(taskId)}")
The worker name is returned as expected, but the SlaveCurrentTaskIds returns an empty string.
I know I’m probably missing something simple here ;).
Thanks,
-Jake
Hi @zainali
It seems like the event is happening a bit too early in the render process for what I’m trying to accomplish. I was hoping to grab the taskId before the plugin loads. Then modify an env var with that info.
The taskId is empty when I print it.
But this:
print(workerinfo)
returns:
taskevent: worker-1 : Idle
Which makes me think that it’s evaluating before the worker picks up the task?
Thanks,
-Jake
Seems like a better place for me to do what I need is in a JobPreLoad or PluginPreLoad context. I’m able to set the env vars as necessary there.
Thanks,
-Jake