fix response drain order

Signed-off-by: Tomáš Freund <tomas.freund@datamole.cz>
This commit is contained in:
Tomáš Freund 2021-03-19 23:46:54 +01:00
parent adb69554a7
commit 09e755e1e5
1 changed files with 1 additions and 1 deletions

View File

@ -97,11 +97,11 @@ 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
}
shouldRetry, err := n.retrier.Check(resp.StatusCode, resp.Body)
notify.Drain(resp)
if err != nil {
return shouldRetry, err
}