From b947a466a9de005ead9788ae09683ffcee1b24f3 Mon Sep 17 00:00:00 2001 From: 710leo <710leo@gmail.com> Date: Sun, 25 Jul 2021 18:19:18 +0800 Subject: [PATCH] fix: alert ineffective on sunday --- alert/consume.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alert/consume.go b/alert/consume.go index f0e15c9d..a2842560 100644 --- a/alert/consume.go +++ b/alert/consume.go @@ -258,6 +258,8 @@ func isNoneffective(event *models.AlertEvent, alertRule *models.AlertRule) bool } } + alertRule.EnableDaysOfWeek = strings.Replace(alertRule.EnableDaysOfWeek, "7", "0", 1) + if !strings.Contains(alertRule.EnableDaysOfWeek, triggerWeek) { logger.Debugf("event:%+v alert rule:%+v triggerWeek Noneffective", event, alertRule) return true