Fix infinite recursion bug in Alert merge

This commit is contained in:
Fabian Reinartz 2015-10-15 16:21:36 +02:00
parent fa7955c9bc
commit 78008cd012

View File

@ -65,7 +65,7 @@ func Alerts(alerts ...*Alert) model.Alerts {
// A new alert is returned, the labels are assumed to be equal.
func (a *Alert) Merge(o *Alert) *Alert {
// Let o always be the younger alert.
if !a.UpdatedAt.Before(o.UpdatedAt) {
if o.UpdatedAt.Before(a.UpdatedAt) {
return o.Merge(a)
}