mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-17 20:05:17 +00:00
Merge pull request #1672 from aixeshunter/master
Unused function 'QTimeRange' and empty slice declaration via literal
This commit is contained in:
commit
b3972f3adc
@ -599,8 +599,6 @@ type query struct {
|
||||
// should be dropped from a result set for a given time.
|
||||
type silenceFilter func(*pb.Silence, *Silences, time.Time) (bool, error)
|
||||
|
||||
var errNotSupported = errors.New("query parameter not supported")
|
||||
|
||||
// QIDs configures a query to select the given silence IDs.
|
||||
func QIDs(ids ...string) QueryParam {
|
||||
return func(q *query) error {
|
||||
@ -609,15 +607,6 @@ func QIDs(ids ...string) QueryParam {
|
||||
}
|
||||
}
|
||||
|
||||
// QTimeRange configures a query to search for silences that are active
|
||||
// in the given time range.
|
||||
// TODO(fabxc): not supported yet.
|
||||
func QTimeRange(start, end time.Time) QueryParam {
|
||||
return func(q *query) error {
|
||||
return errNotSupported
|
||||
}
|
||||
}
|
||||
|
||||
// QMatches returns silences that match the given label set.
|
||||
func QMatches(set model.LabelSet) QueryParam {
|
||||
return func(q *query) error {
|
||||
|
@ -81,7 +81,7 @@ func (a *Alerts) gc() {
|
||||
a.Lock()
|
||||
defer a.Unlock()
|
||||
|
||||
resolved := []*types.Alert{}
|
||||
var resolved []*types.Alert
|
||||
for fp, alert := range a.c {
|
||||
if alert.Resolved() {
|
||||
delete(a.c, fp)
|
||||
|
Loading…
Reference in New Issue
Block a user