Skip to content

Commit

Permalink
RateLimit bug fix (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnushreeHS authored Jun 6, 2024
1 parent 17efece commit c0ae04e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (c *Client) communicate(method string, suffix []string, query, data interfa
}
return body, InvalidCredentialsError
case http.StatusTooManyRequests:
delay := 2 + c.Retries
delay := 1 << c.Retries
if delay <= c.RetryMaxDelay && delay > 0 && c.MaxRetries > 0 {
time.Sleep(time.Duration(delay) * time.Second)
c.MaxRetries = c.MaxRetries - 1
Expand Down

0 comments on commit c0ae04e

Please sign in to comment.