3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-23 05:15:30 +00:00

Prevent the timeout callback from running if all tasks completed.

Signed-off-by: William D. Jones <thor0505@comcast.net>
This commit is contained in:
William D. Jones 2019-04-02 21:20:30 -04:00 committed by Ed Bordin
parent b6007aa68c
commit a320462976

View file

@ -263,7 +263,8 @@ class SbyJob:
async def task_poller(self):
if self.opt_timeout is not None:
timer_fut = asyncio.ensure_future(self.timekeeper())
timer_fut.add_done_callback(partial(SbyJob.timeout, self))
done_cb = partial(SbyJob.timeout, self)
timer_fut.add_done_callback(done_cb)
for task in self.tasks_pending:
await task.maybe_spawn()
@ -280,6 +281,7 @@ class SbyJob:
await task.shutdown_and_notify()
if self.opt_timeout is not None:
timer_fut.remove_done_callback(done_cb)
timer_fut.cancel()
# Required on Windows. I am unsure why, but subprocesses that were