ruff: Fix PLC0206 Extracting value from dictionary without calling .items().

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-12-20 12:18:06 -08:00
committed by Tim Abbott
parent 5bad79dd5b
commit 19b8cde27f
18 changed files with 87 additions and 117 deletions

View File

@@ -54,7 +54,7 @@ for line in output.split("\n"):
now = int(time.time())
for queue_name in consumers:
for queue_name, count in consumers.items():
target_count = 1
if queue_name == "notify_tornado":
target_count = TORNADO_PROCESSES
@@ -67,6 +67,6 @@ for queue_name in consumers:
atomic_nagios_write(
"check-rabbitmq-consumers-" + queue_name,
"critical" if consumers[queue_name] < target_count else "ok",
f"queue {queue_name} has {consumers[queue_name]} consumers, needs {target_count}",
"critical" if count < target_count else "ok",
f"queue {queue_name} has {count} consumers, needs {target_count}",
)