mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-17 19:17:07 +00:00
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 {
|
for {
|
||||||
i++
|
i++
|
||||||
|
// Always check the context first to not notify again.
|
||||||
|
select {
|
||||||
|
case <-ctx.Done():
|
||||||
|
return ctx.Err()
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-tick.C:
|
case <-tick.C:
|
||||||
|
Loading…
Reference in New Issue
Block a user