mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Add a feature flag to periodically save states (#80987)
This commit is contained in:
committed by
GitHub
parent
f7fd8e6cd1
commit
aa25776f81
@@ -30,7 +30,7 @@ type AlertInstanceManager interface {
|
||||
}
|
||||
|
||||
type StatePersister interface {
|
||||
Async(ctx context.Context, ticker *clock.Ticker, cache *cache)
|
||||
Async(ctx context.Context, cache *cache)
|
||||
Sync(ctx context.Context, span trace.Span, states, staleStates []StateTransition)
|
||||
}
|
||||
|
||||
@@ -103,6 +103,11 @@ func NewManager(cfg ManagerCfg, statePersister StatePersister) *Manager {
|
||||
return m
|
||||
}
|
||||
|
||||
func (st *Manager) Run(ctx context.Context) error {
|
||||
st.persister.Async(ctx, st.cache)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (st *Manager) Warm(ctx context.Context, rulesReader RuleReader) {
|
||||
if st.instanceStore == nil {
|
||||
st.log.Info("Skip warming the state because instance store is not configured")
|
||||
|
||||
Reference in New Issue
Block a user