fix opsgenie retry handling logic error
Signed-off-by: Tomáš Freund <tomas.freund@datamole.cz>
This commit is contained in:
parent
79dfb86c7b
commit
adb69554a7
|
@ -97,14 +97,13 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
|
||||||
|
|
||||||
for _, req := range requests {
|
for _, req := range requests {
|
||||||
resp, err := n.client.Do(req)
|
resp, err := n.client.Do(req)
|
||||||
|
notify.Drain(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
defer notify.Drain(resp)
|
shouldRetry, err := n.retrier.Check(resp.StatusCode, resp.Body)
|
||||||
|
if err != nil {
|
||||||
success, err := n.retrier.Check(resp.StatusCode, resp.Body)
|
return shouldRetry, err
|
||||||
if !success {
|
|
||||||
return false, err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
|
|
Loading…
Reference in New Issue