Alerting: Return chan <-error for #61811 (#61858)

This commit is contained in:
George Robinson
2023-01-24 15:41:38 +00:00
committed by GitHub
parent cc502bbfbd
commit 239d94205a
7 changed files with 35 additions and 13 deletions

View File

@@ -22,8 +22,10 @@ type RuleReader interface {
// Historian maintains an audit log of alert state history.
type Historian interface {
// RecordStates writes a number of state transitions for a given rule to state history.
RecordStatesAsync(ctx context.Context, rule *models.AlertRule, states []StateTransition)
// RecordStates writes a number of state transitions for a given rule to state history. It returns a channel that
// is closed when writing the state transitions has completed. If an error has occurred, the channel will contain a
// non-nil error.
RecordStatesAsync(ctx context.Context, rule *models.AlertRule, states []StateTransition) <-chan error
}
// ImageCapturer captures images.