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:
Jannick Fahlbusch ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ 2018-10-03 13:08:23 +02:00 committed by Max Inden
parent c9e250dab1
commit 30aae38c95
1 changed files with 4 additions and 4 deletions

View File

@ -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
}