Merge pull request #446 from prometheus/fabxc-retryctx

notify: always check context before retrying
This commit is contained in:
Fabian Reinartz 2016-08-05 10:43:47 +02:00 committed by GitHub
commit 4b3830310e
1 changed files with 6 additions and 0 deletions

View File

@ -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: