self.output_callback = None
self.exit_callback = None
- self.job.tasks_all.append(self)
+ self.job.tasks_pending.append(self)
def register_dep(self, next_task):
if self.finished:
stderr=(subprocess.STDOUT if self.logstderr else None))
fl = fcntl.fcntl(self.p.stdout, fcntl.F_GETFL)
fcntl.fcntl(self.p.stdout, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+ self.job.tasks_pending.remove(self)
self.job.tasks_running.append(self)
self.running = True
return
}
self.tasks_running = []
- self.tasks_all = []
+ self.tasks_pending = []
self.start_clock_time = time()
print(line, file=f)
def taskloop(self):
- for task in self.tasks_all:
+ for task in self.tasks_pending:
task.poll()
- while len(self.tasks_running):
+ while len(self.tasks_running) or len(self.tasks_pending):
fds = []
for task in self.tasks_running:
if task.running:
for task in self.tasks_running:
task.poll()
+ for task in self.tasks_pending:
+ task.poll()
+
if self.opt_timeout is not None:
total_clock_time = int(time() - self.start_clock_time)
if total_clock_time > self.opt_timeout: