Switch to use Too Many Requests response code

Name the 429 status code
This commit is contained in:
Satnam Singh
2015-01-23 17:17:11 -08:00
parent b3fffe0efb
commit 3a9e6d8f29
4 changed files with 14 additions and 9 deletions

View File

@@ -483,7 +483,8 @@ func (r *Request) Do() Result {
continue
}
if resp.StatusCode == http.StatusServiceUnavailable {
// Check to see if we got a 429 Too Many Requests response code.
if resp.StatusCode == errors.StatusTooManyRequests {
if retries < 10 {
retries++
if waitFor := resp.Header.Get("Retry-After"); waitFor != "" {