From 80ad9d9dc3f6011237364a8958e11951edc167a6 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 4 Jul 2019 18:57:58 -0600 Subject: [PATCH] v1.2.2: bugfix change detection --- watchdog.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/watchdog.go b/watchdog.go index 755acae..f0c0ca3 100644 --- a/watchdog.go +++ b/watchdog.go @@ -81,6 +81,7 @@ func (d *Dog) watch() { return } + changed := d.changed time.Sleep(time.Duration(5) * time.Second) err2 := d.check() @@ -108,7 +109,8 @@ func (d *Dog) watch() { // TODO what if the server is flip-flopping rapidly? // how to rate limit? // "{{ .Server }} is on cooldown for 30 minutes" - if d.changed { + if changed { + changed = false d.notify("went down") if StatusUp == d.status { break