Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry implementation is wrong #254

Open
bhuvanvenkat-plivo opened this issue Dec 1, 2020 · 0 comments
Open

Retry implementation is wrong #254

bhuvanvenkat-plivo opened this issue Dec 1, 2020 · 0 comments

Comments

@bhuvanvenkat-plivo
Copy link

bhuvanvenkat-plivo commented Dec 1, 2020

https://github.com/parnurzeal/gorequest/blob/develop/gorequest.go#L1102

for {
	resp, body, errs = s.getResponseBytes()
	if errs != nil {
		return nil, nil, errs
	}
	if s.isRetryableRequest(resp) {
		resp.Header.Set("Retry-Count", strconv.Itoa(s.Retryable.Attempt))
		break
	}
}

s.getResponseBytes() will be executing the http request. Any error set in s.Errors or errs is not nil isRetryableRequest() check is not performed.
Any retry set to the SuperAgent object is not considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant