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 {
|
||||
resp, err := n.client.Do(req)
|
||||
notify.Drain(resp)
|
||||
if err != nil {
|
||||
return true, err
|
||||
}
|
||||
defer notify.Drain(resp)
|
||||
|
||||
success, err := n.retrier.Check(resp.StatusCode, resp.Body)
|
||||
if !success {
|
||||
return false, err
|
||||
shouldRetry, err := n.retrier.Check(resp.StatusCode, resp.Body)
|
||||
if err != nil {
|
||||
return shouldRetry, err
|
||||
}
|
||||
}
|
||||
return true, nil
|
||||
|
|
Loading…
Reference in New Issue