From 6f0d441e399d925435330875636e7b310665f7cb Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Wed, 4 Nov 2015 17:17:37 +0100 Subject: [PATCH] Fix unlocked write and unnecessary condition --- dispatch.go | 5 ++--- notify/notify.go | 2 +- ui/app/partials/status.html | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dispatch.go b/dispatch.go index a425951f..96812367 100644 --- a/dispatch.go +++ b/dispatch.go @@ -291,7 +291,6 @@ func (ag *aggrGroup) insert(alert *types.Alert) { // Immediately trigger a flush if the wait duration for this // alert is already over. if !ag.hasSent && alert.StartsAt.Add(ag.opts.GroupWait).Before(time.Now()) { - fmt.Println("early") ag.next.Reset(0) } } @@ -332,8 +331,8 @@ func (ag *aggrGroup) flush(notify func(...*types.Alert) bool) { delete(ag.alerts, fp) } } + + ag.hasSent = true ag.mtx.Unlock() } - - ag.hasSent = true } diff --git a/notify/notify.go b/notify/notify.go index 805d603c..326d8443 100644 --- a/notify/notify.go +++ b/notify/notify.go @@ -249,7 +249,7 @@ func (n *DedupingNotifier) Notify(ctx context.Context, alerts ...*types.Alert) e } } } - } else if a.Resolved() && !sendResolved { + } else if a.Resolved() { continue } diff --git a/ui/app/partials/status.html b/ui/app/partials/status.html index fb3603d5..46b94dd2 100644 --- a/ui/app/partials/status.html +++ b/ui/app/partials/status.html @@ -1,5 +1,5 @@
-

Status

+

Status