From 3c14a02770f9fc9fea5ec61d0962224cce7d21a2 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 2 Sep 2021 10:20:04 -0700 Subject: [PATCH] Continue checking all monitors after sending alert Previously this was mistakenly returning after sending an alert. Now all alerts will be sent unless there is an exception on one of them. --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index d2514e8..97249e2 100644 --- a/main.go +++ b/main.go @@ -79,7 +79,11 @@ func checkMonitors(config *Config) error { Metrics.CountCheck(monitor.Name, success, monitor.LastCheckMilliseconds(), hasAlert) if alertNotice != nil { - return sendAlerts(config, monitor, alertNotice) + err := sendAlerts(config, monitor, alertNotice) + // If there was an error in sending an alert, exit early and bubble it up + if err != nil { + return err + } } } }