From dfa5d176704139119aa649a19c773603e4627d7b Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Mon, 20 Aug 2018 16:27:13 +0200 Subject: [PATCH] don't write to notification journal when testing notifier/rule --- pkg/services/alerting/notifier.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/alerting/notifier.go b/pkg/services/alerting/notifier.go index 39f91c1caea..7fbd956f4f9 100644 --- a/pkg/services/alerting/notifier.go +++ b/pkg/services/alerting/notifier.go @@ -77,6 +77,10 @@ func (n *notificationService) sendNotifications(evalContext *EvalContext, notifi //send notification success := not.Notify(evalContext) == nil + if evalContext.IsTestRun { + return nil + } + //write result to db. cmd := &m.RecordNotificationJournalCommand{ OrgId: evalContext.Rule.OrgId,