mirror of
https://github.com/prymitive/karma
synced 2026-08-28 11:17:28 +00:00
Sort alert groups so they are returned in a stable order
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user