Merge pull request #446 from prometheus/fabxc-retryctx
notify: always check context before retrying
This commit is contained in:
commit
4b3830310e
|
@ -186,6 +186,12 @@ func (n *RetryNotifier) Notify(ctx context.Context, alerts ...*types.Alert) erro
|
|||
|
||||
for {
|
||||
i++
|
||||
// Always check the context first to not notify again.
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
default:
|
||||
}
|
||||
|
||||
select {
|
||||
case <-tick.C:
|
||||
|
|
Loading…
Reference in New Issue