def _run_local(self, args, callback): cmd = [ os.path.join(os.path.dirname(sys.executable), "ngi_pipeline_start.py") ] + args p = background.Subprocess(callback, timeout=-1, args=[str(x) for x in cmd]) p.start()
def get(self, secs): run_id = str(uuid.uuid1()) def set_done(status, stdout, stderr, has_timed_out): self.application.runmonitor.set_status( run_id, "finished" if status == 0 else "failed") cmd = ['sleep', secs] p = background.Subprocess(set_done, timeout=-1, args=[str(x) for x in cmd]) p.start() self.application.runmonitor.set_status(run_id, "running") self.write(run_id)