Fix unlocked write and unnecessary condition

This commit is contained in:
Fabian Reinartz 2015-11-04 17:17:37 +01:00
parent 08948391df
commit 6f0d441e39
3 changed files with 4 additions and 5 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -1,5 +1,5 @@
<div ng-controller="StatusCtrl">
<h2>Status</h2>
<h1>Status</h1>
<table>
<tbody>
<tr>