fix lint errors

Signed-off-by: Mustafain Ali Khan <mustalik@amazon.com>
This commit is contained in:
Mustafain Ali Khan 2025-02-20 12:50:50 -08:00
parent dfce8e73d4
commit 066d922e72
2 changed files with 7 additions and 7 deletions

View file

@ -73,9 +73,9 @@ type Group struct {
// Rule group evaluation iteration function,
// defaults to DefaultEvalIterationFunc.
evalIterationFunc GroupEvalIterationFunc
alertStore AlertStore
appOpts *storage.AppendOptions
alertStore AlertStore
appOpts *storage.AppendOptions
}
// GroupEvalIterationFunc is used to implement and extend rule group
@ -146,8 +146,8 @@ func NewGroup(o GroupOptions) *Group {
logger: opts.Logger.With("file", o.File, "group", o.Name),
metrics: metrics,
evalIterationFunc: evalIterationFunc,
appOpts: &storage.AppendOptions{DiscardOutOfOrder: true},
alertStore: o.AlertStore,
appOpts: &storage.AppendOptions{DiscardOutOfOrder: true},
}
}

View file

@ -115,12 +115,12 @@ func (s *FileStore) SetAlerts(key uint64, groupKey string, alerts []*Alert) erro
s.stateMtx.Lock()
defer s.stateMtx.Unlock()
// Update in memory
if alerts != nil {
s.alertsByRule[key] = alerts
} else {
if alerts == nil {
return nil
}
// Update in memory
s.alertsByRule[key] = alerts
// flush in memory state to file storage
file, err := os.Create(s.path)
if err != nil {