diff options
author | Matthew Waters <matthew@centricular.com> | 2022-11-20 16:37:24 +1100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2022-12-11 01:57:18 +0000 |
commit | bebbdb39972b318918a1aec373dc4df029224f52 (patch) | |
tree | 5eba0096a4d5c3f4fdffbf90ff1be01cde88946c | |
parent | bdd768ba16de62a12def9fec6281737f434c67c1 (diff) |
oven: output status line at least every minute
Fixes https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/393
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1052>
-rw-r--r-- | cerbero/build/oven.py | 10 | ||||
-rw-r--r-- | cerbero/utils/shell.py | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/cerbero/build/oven.py b/cerbero/build/oven.py index e03326a4..5f3155a4 100644 --- a/cerbero/build/oven.py +++ b/cerbero/build/oven.py @@ -398,10 +398,20 @@ class Oven (object): tasks.append(asyncio.ensure_future(cook_recipe_worker(default_queue, set(all_steps) - set(used_steps)))) async def recipes_done(): + async def heartbeat_output(): + while True: + await asyncio.sleep(60) + self._build_status_printer.heartbeat() + + heartbeat_task = asyncio.create_task(heartbeat_output()) + while built_recipes & recipe_targets != recipe_targets: for q in queues.values(): await q.join() + heartbeat_task.cancel() + + # push the initial set of recipes that have no dependencies to start # building for recipe in find_buildable_recipes (): diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py index a8fdfd1f..74bf64d9 100644 --- a/cerbero/utils/shell.py +++ b/cerbero/utils/shell.py @@ -745,3 +745,9 @@ class BuildStatusPrinter: def output_status_line(self): if self.interactive: m.output_status(self.generate_status_line()) + + def heartbeat(self): + if not self.interactive: + m.message(self.generate_status_line()) + else: + self.output_status_line() |