From 375dfd1bc04f0890c055b13d931f293d84062d2f Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Sun, 13 Aug 2023 10:34:55 -0400 Subject: [PATCH] Don't emit error messages as emails Fixes #114. --- gcn_email/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcn_email/core.py b/gcn_email/core.py index eba2471..7537575 100644 --- a/gcn_email/core.py +++ b/gcn_email/core.py @@ -92,6 +92,10 @@ def recieve_alerts(consumer): table = get_email_notification_subscription_table() while True: for message in consumer.consume(timeout=1): + error = message.error() + if error is not None: + log.error('Error consuming message: %s', error) + continue topic = message.topic() metrics.received.labels(topic).inc() recipients = query_and_project_subscribers(table, topic)