mirror of
https://github.com/prymitive/karma
synced 2026-08-23 11:56:20 +00:00
fix(api): dedup should be done before alert limit
This commit is contained in:
committed by
Łukasz Mierzwa
parent
055f8d9f9a
commit
716e62c347
+3
-2
@@ -417,6 +417,9 @@ func alerts(w http.ResponseWriter, r *http.Request) {
|
||||
ag.LatestStartsAt = ag.FindLatestStartsAt()
|
||||
ag.Hash = ag.ContentFingerprint()
|
||||
apiAG := models.APIAlertGroup{AlertGroup: *ag, TotalAlerts: len(ag.Alerts)}
|
||||
apiAG.DedupSharedMaps()
|
||||
resp.TotalAlerts += len(ag.Alerts)
|
||||
|
||||
alertLimit, found := request.GroupLimits[ag.ID]
|
||||
if !found {
|
||||
if request.DefaultGroupLimit > 0 {
|
||||
@@ -429,8 +432,6 @@ func alerts(w http.ResponseWriter, r *http.Request) {
|
||||
alertLimit = apiAG.TotalAlerts
|
||||
}
|
||||
apiAG.Alerts = apiAG.Alerts[0:alertLimit]
|
||||
apiAG.DedupSharedMaps()
|
||||
resp.TotalAlerts += len(ag.Alerts)
|
||||
|
||||
grid, found := grids[gridLabelValue]
|
||||
if !found {
|
||||
|
||||
Reference in New Issue
Block a user