Always verify links
This commit is contained in:
@@ -258,6 +258,10 @@ func (r *HTTPClient) shouldRetry(req *http.Request, resp *http.Response, err err
|
||||
if apiErr, ok := err.(*ApiErrorResponse); ok {
|
||||
switch apiErr.Code {
|
||||
case 5: // Slow down (retry infinitely)
|
||||
secs := r.backoff(attempts, rateLimitSleep)
|
||||
r.log.Debugf("API rate limit reached, retrying in %d seconds", secs/time.Second)
|
||||
time.Sleep(secs)
|
||||
return 0
|
||||
case 34: // Too many requests (retry infinitely)
|
||||
secs := r.backoff(attempts, rateLimitSleep)
|
||||
r.log.Debugf("API rate limit reached, retrying in %d seconds", secs/time.Second)
|
||||
|
||||
Reference in New Issue
Block a user