In my custom even plugin, I’m trying to set a JobExtraInfoKeyValue. If I try to get that value in the same OnJobStarted
it returns the value that i set. However, if i try to call it in another function, it doesn’t persist. I’ve verfied that the job id matches up when trying this but cannot figure out why this doesn’t work. Am I misunderstanding SetJobExtraInfoKeyValue
?
Example Code
def OnJobStarted(self, job):
self.logger("example job started.")
self.logger("JobId %s" % str(job.JobId))
job.SetJobExtraInfoKeyValue("example_str", "0")
job.GetJobExtraInfoKeyValue("example_str")
RepositoryUtils.SaveJob(job)
def OnJobFinished(self, job):
self.logger("example job finished")
self.logger("JobId %s" % str(job.JobId))
self.logger("OnJobFinished error_count %s" % job.GetJobExtraInfoKeyValue("example_str"))