Fix fix for chained tasks
authorClifford Wolf <clifford@clifford.at>
Tue, 1 May 2018 13:58:55 +0000 (15:58 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 1 May 2018 13:58:55 +0000 (15:58 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
sbysrc/sby_core.py

index 6d5cd63fd9a31573be3efc2c3457ffe3d3d89c72..a18687bd7feb8bf88b48c62158b9fb221a3d73ce 100644 (file)
@@ -38,14 +38,14 @@ class SbyTask:
         self.linebuffer = ""
         self.logstderr = logstderr
 
+        self.job.tasks_pending.append(self)
+
         for dep in self.deps:
             dep.register_dep(self)
 
         self.output_callback = None
         self.exit_callback = None
 
-        self.job.tasks_pending.append(self)
-
     def register_dep(self, next_task):
         if self.finished:
             next_task.poll()
@@ -179,7 +179,7 @@ class SbyJob:
         for task in self.tasks_pending:
             task.poll()
 
-        while len(self.tasks_running) or len(self.tasks_pending):
+        while len(self.tasks_running):
             fds = []
             for task in self.tasks_running:
                 if task.running: