mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix lint errors
Signed-off-by: Mustafain Ali Khan <mustalik@amazon.com>
This commit is contained in:
parent
dfce8e73d4
commit
066d922e72
|
@ -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},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue