store: Fix ineffectual assignment for default GC interval (#1568)
This fixes the ineffectual assignment for the default GC interval when specifiying a duration of 0 Signed-off-by: Jannick Fahlbusch <git@jf-projects.de>
This commit is contained in:
parent
c9e250dab1
commit
30aae38c95
|
@ -29,16 +29,16 @@ type Alerts struct {
|
|||
|
||||
// NewAlerts returns a new Alerts struct.
|
||||
func NewAlerts(gcInterval time.Duration) *Alerts {
|
||||
if gcInterval == 0 {
|
||||
gcInterval = time.Minute
|
||||
}
|
||||
|
||||
a := &Alerts{
|
||||
c: make(map[model.Fingerprint]*types.Alert),
|
||||
cb: func(_ []*types.Alert) {},
|
||||
gcInterval: gcInterval,
|
||||
}
|
||||
|
||||
if gcInterval == 0 {
|
||||
gcInterval = time.Minute
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue