From 528c9122f220ac14941c3aa86eb3ae62013c2634 Mon Sep 17 00:00:00 2001 From: Norwin Roosen Date: Sun, 10 Feb 2019 16:08:01 +0100 Subject: [PATCH] fix notification retry logic --- core/notifiers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/notifiers.go b/core/notifiers.go index 14c87ec..4019e26 100644 --- a/core/notifiers.go +++ b/core/notifiers.go @@ -84,9 +84,10 @@ func (results BoxCheckResults) SendNotifications(notifyTypes []string, useCache var submitErr error submitErr = notifier.Submit(notification) - for retry := 1; submitErr != nil && retry < 3; retry++ { + for retry := 0; submitErr != nil && retry < 2; retry++ { + notifyLog.Warnf("sending notification failed (retry %v): %v", retry, submitErr) time.Sleep(10 * time.Second) - notifyLog.Infof("trying to submit (retry %v)", retry) + submitErr = notifier.Submit(notification) } if submitErr != nil { notifyLog.Error(submitErr)