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, // Rule group evaluation iteration function,
// defaults to DefaultEvalIterationFunc. // defaults to DefaultEvalIterationFunc.
evalIterationFunc GroupEvalIterationFunc evalIterationFunc GroupEvalIterationFunc
alertStore AlertStore
appOpts *storage.AppendOptions appOpts *storage.AppendOptions
alertStore AlertStore
} }
// GroupEvalIterationFunc is used to implement and extend rule group // 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), logger: opts.Logger.With("file", o.File, "group", o.Name),
metrics: metrics, metrics: metrics,
evalIterationFunc: evalIterationFunc, evalIterationFunc: evalIterationFunc,
appOpts: &storage.AppendOptions{DiscardOutOfOrder: true},
alertStore: o.AlertStore, 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() s.stateMtx.Lock()
defer s.stateMtx.Unlock() defer s.stateMtx.Unlock()
// Update in memory if alerts == nil {
if alerts != nil {
s.alertsByRule[key] = alerts
} else {
return nil return nil
} }
// Update in memory
s.alertsByRule[key] = alerts
// flush in memory state to file storage // flush in memory state to file storage
file, err := os.Create(s.path) file, err := os.Create(s.path)
if err != nil { if err != nil {