diff --git a/plugins/houdini/pdg/types/afanasyscheduler.py b/plugins/houdini/pdg/types/afanasyscheduler.py index 84351bbe0..f1b84685d 100644 --- a/plugins/houdini/pdg/types/afanasyscheduler.py +++ b/plugins/houdini/pdg/types/afanasyscheduler.py @@ -53,6 +53,9 @@ def onStart(self): def onStop(self): logger.debug("onStop") self.stopCallbackServer() + if self.job_id is not None: + af.Cmd().deleteJobById(self.job_id) + self.job_id = None return True @@ -95,7 +98,6 @@ def onStartCook(self, static, cook_set): job.blocks.append(block) - self.job_id = 0 try: self.job_id = job.send() self.job_id = self.job_id[1]['id'] @@ -114,6 +116,10 @@ def onStopCook(self, cancel): """ logger.debug("onStopCook") self.stopCallbackServer() + if self.job_id is not None: + af.Cmd().deleteJobById(self.job_id) + self.job_id = None + return True