From b003af64ccab6b4462d0e1fe8598c01964e70a44 Mon Sep 17 00:00:00 2001 From: Henri Dickson <90480431+alphatownsman@users.noreply.github.com> Date: Wed, 23 Aug 2023 08:12:21 -0400 Subject: [PATCH] Do not print "Scheduling 0 handled" unless settings.DEBUG is on (#636) --- stator/runner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stator/runner.py b/stator/runner.py index 35a810e..5682d46 100644 --- a/stator/runner.py +++ b/stator/runner.py @@ -163,9 +163,9 @@ class StatorRunner: """ with sentry.start_transaction(op="task", name="stator.run_scheduling"): for model in self.models: - print( - f"{model._meta.label_lower}: Scheduling ({self.handled.get(model._meta.label_lower, 0)} handled)" - ) + num = self.handled.get(model._meta.label_lower, 0) + if num or settings.DEBUG: + print(f"{model._meta.label_lower}: Scheduling ({num} handled)") self.submit_stats(model) model.transition_clean_locks()