Alerting nested state cache (#33666)
* nest cache by orgID, ruleUID, stateID * update accessors to use new cache structure * test and linter fixup * fix panic Co-authored-by: Kyle Brandt <kyle@grafana.com> * add comment to identify what's going on with nested maps in cache Co-authored-by: Kyle Brandt <kyle@grafana.com>
This commit is contained in:
co-authored by
Kyle Brandt
parent
5072fefc22
commit
39099bf3c0
@@ -306,7 +306,13 @@ func (sch *schedule) Ticker(grafanaCtx context.Context, stateManager *state.Mana
|
||||
}
|
||||
case <-grafanaCtx.Done():
|
||||
err := dispatcherGroup.Wait()
|
||||
sch.saveAlertStates(stateManager.GetAll())
|
||||
orgIdsCmd := models.FetchUniqueOrgIdsQuery{}
|
||||
if err := sch.instanceStore.FetchOrgIds(&orgIdsCmd); err != nil {
|
||||
sch.log.Error("unable to fetch orgIds", "msg", err.Error())
|
||||
}
|
||||
for _, v := range orgIdsCmd.Result {
|
||||
sch.saveAlertStates(stateManager.GetAll(v.DefinitionOrgID))
|
||||
}
|
||||
stateManager.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user