Skip to content

Commit

Permalink
beautify code
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Aug 26, 2022
1 parent b5ecb93 commit fe49f38
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1345,10 +1345,7 @@ func (c *Client) do(r *Request) (resp *Response, err error) {
}

if r.retryOption == nil || r.RetryAttempt >= r.retryOption.MaxRetries { // absolutely cannot retry.
if err != nil { // return immediately if error occurs.
return
}
break // jump out to execute the ResponseMiddlewares if possible.
return
}

// check retry whether is needed.
Expand All @@ -1360,7 +1357,7 @@ func (c *Client) do(r *Request) (resp *Response, err error) {
}
}
if !needRetry { // no retry is needed.
break // jump out to execute the ResponseMiddlewares.
return
}

// need retry, attempt to retry
Expand Down

0 comments on commit fe49f38

Please sign in to comment.