Fix decisions list with --no-simu flag (#1482)
* Fix decisions list with --no-simu flag
This commit is contained in:
parent
0f4ab71f01
commit
a645c928d4
|
@ -558,7 +558,6 @@ func BuildAlertRequestFromFilter(alerts *ent.AlertQuery, filter map[string][]str
|
||||||
if v[0] == "false" {
|
if v[0] == "false" {
|
||||||
alerts = alerts.Where(alert.SimulatedEQ(false))
|
alerts = alerts.Where(alert.SimulatedEQ(false))
|
||||||
}
|
}
|
||||||
delete(filter, "simulated")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := filter["origin"]; ok {
|
if _, ok := filter["origin"]; ok {
|
||||||
|
@ -642,6 +641,8 @@ func BuildAlertRequestFromFilter(alerts *ent.AlertQuery, filter map[string][]str
|
||||||
continue
|
continue
|
||||||
case "sort":
|
case "sort":
|
||||||
continue
|
continue
|
||||||
|
case "simulated":
|
||||||
|
continue
|
||||||
default:
|
default:
|
||||||
return nil, errors.Wrapf(InvalidFilter, "Filter parameter '%s' is unknown (=%s)", param, value[0])
|
return nil, errors.Wrapf(InvalidFilter, "Filter parameter '%s' is unknown (=%s)", param, value[0])
|
||||||
}
|
}
|
||||||
|
@ -778,10 +779,11 @@ func (c *Client) QueryAlertWithFilter(filter map[string][]string) ([]*ent.Alert,
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
ret = append(ret, result[0:diff]...)
|
ret = append(ret, result[0:diff]...)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ret = append(ret, result...)
|
ret = append(ret, result...)
|
||||||
}
|
}
|
||||||
if len(ret) == limit || len(ret) == 0 {
|
if len(ret) == limit || len(ret) == 0 || len(ret) < paginationSize {
|
||||||
c.Log.Debugf("Pagination done len(ret) = %d", len(ret))
|
c.Log.Debugf("Pagination done len(ret) = %d", len(ret))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue