From e03791c2fae082e542a4008abf3e37f41ed6f61b Mon Sep 17 00:00:00 2001 From: AP Date: Wed, 7 Oct 2026 12:24:09 +0530 Subject: [PATCH] status: surface jobs with unrecognized statuses The summary line only printed the five known statuses, so a job in any other state was counted but never shown. Build the line from whatever statuses are actually present. --- src/serialq/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/serialq/__init__.py b/src/serialq/__init__.py index 1485743..25a0482 100644 --- a/src/serialq/__init__.py +++ b/src/serialq/__init__.py @@ -511,7 +511,7 @@ def cmd_status(args): held = not gate.try_acquire() if not held: gate.release() - counts = {"queued": 0, "running": 0, "done": 0, "failed": 0, "cancelled": 0} + counts = {} running_id = None def _count(jobs): @@ -525,8 +525,10 @@ def _count(jobs): with_jobs(paths, _count) running_id = nonlocal_running[0] print(f"gate {args.gate!r}: {'BUSY' if held else 'free'}") - print(f"queued={counts['queued']} running={counts['running']} " - f"done={counts['done']} failed={counts['failed']} cancelled={counts['cancelled']}") + order = ["queued", "running", "done", "failed", "cancelled"] + parts = [f"{s}={counts.get(s, 0)}" for s in order] + parts += [f"{s}={c}" for s, c in sorted(counts.items()) if s not in order] + print(" ".join(parts)) if running_id: print(f"running job: {running_id}")