From 2b82f7c8f2d47d28bb507a6ecf65a26498a49207 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sun, 26 Jan 2025 07:54:31 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E2=80=94=20Fix=20bug=20in=20ret?= =?UTF-8?q?ry=5Fbefore=5Fnotification=20logic=20when=20success?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ argos/server/alerting.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da3adbc..01be416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +🐛 — Fix bug in retry_before_notification logic when success + ## 0.7.2 Date: 2025-01-24 diff --git a/argos/server/alerting.py b/argos/server/alerting.py index 81b3a3d..d533ed4 100644 --- a/argos/server/alerting.py +++ b/argos/server/alerting.py @@ -36,7 +36,7 @@ def need_alert( # create notification of success immediately if ( status == "success" - and task.contiguous_failures >= task.retry_before_notification + and task.contiguous_failures >= task.retry_before_notification + 1 ): send_notif = True task.contiguous_failures = 0 @@ -56,7 +56,7 @@ def need_alert( task.contiguous_failures = task.retry_before_notification # Severity has not changed, but there has been enough failures # to create a notification - elif task.retry_before_notification + 1 == task.contiguous_failures: + elif task.contiguous_failures == task.retry_before_notification + 1: send_notif = True return send_notif