Do not print "Scheduling 0 handled" unless settings.DEBUG is on (#636)

pull/639/head
Henri Dickson 2023-08-23 08:12:21 -04:00 zatwierdzone przez GitHub
rodzic 671807beb8
commit b003af64cc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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()