Sort alert groups so they are returned in a stable order

This commit is contained in:
Łukasz Mierzwa
2017-06-30 23:41:25 -07:00
parent 175078320e
commit c29cb2c0a9
+4
View File
@@ -50,6 +50,10 @@ func DedupAlerts() []models.AlertGroup {
dedupedGroups = append(dedupedGroups, ag)
}
// sort alert groups so they are always returned in the same order
// use group ID which is unique and immutable
sort.Slice(dedupedGroups, func(i, j int) bool { return dedupedGroups[i].ID < dedupedGroups[j].ID })
return dedupedGroups
}