Fix bug in task management
authorClifford Wolf <clifford@clifford.at>
Mon, 30 Jan 2017 11:04:35 +0000 (12:04 +0100)
committerClifford Wolf <clifford@clifford.at>
Mon, 30 Jan 2017 11:04:35 +0000 (12:04 +0100)
sbysrc/sby_core.py

index c9956cf50fccf842ffa8295d09336b44b17b4c4a..f18138a7edac146fe313616911b8572fe4321385 100644 (file)
@@ -97,11 +97,11 @@ class SbyTask:
 
         if self.p.poll() is not None:
             self.job.log("%s: finished (returncode=%d)" % (self.info, self.p.returncode))
-            self.handle_exit(self.p.returncode)
-
             self.job.tasks_running.remove(self)
             self.running = False
 
+            self.handle_exit(self.p.returncode)
+
             if self.checkretcode and self.p.returncode != 0:
                 self.job.status = "ERROR"
                 self.job.log("%s: job failed. ERROR." % self.info)