From 14d34807ca2e100c0bcd2665b9fbfcca0708bfa6 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Thu, 20 Feb 2025 21:30:57 +0100 Subject: [PATCH] Snappea 'worker done': display task name for the important case of 'quickly eye-balling what-took-you-so-long' this saves those eye-balls a lookup --- CHANGELOG.md | 1 + snappea/foreman.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15dcc3b..00aeb2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Related utilities: * DB indexes for the issue-lists (including filters) * Don't 'eat your own dogfood' (send errors to backend) while running tests * `delete_with_limit` was removed; this removes one tie-in to MySQL/Sqlite (See #21) +* Print task's name in Snappea log when "Done" ## 1.2.0 (11 February 2025) diff --git a/snappea/foreman.py b/snappea/foreman.py index 44b455c..8fd78a5 100644 --- a/snappea/foreman.py +++ b/snappea/foreman.py @@ -187,7 +187,9 @@ class Foreman: for connection in connections.all(): connection.close() - logger.info("Worker done in %.3fs", time.time() - t0) + logger.info( + 'Worker done for "%s.%s" in %.3fs', + function.__module__, function.__name__, time.time() - t0) self.workers.stopped(task_id) self.worker_semaphore.release()