Use default retry values in pagination #3587
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates
paginate()to use the default values forhttp_backoffinstead of explicitmax_retries=20,retry_on_status_codes=429. The default values aremax_retries=5andretry_on_status_codes=(429, 500, 502, 503, 504).Note that with #3577, The retry mechanism now includes smart 429 handling that parses rate limit headers, it basically extracts the number of seconds until the rate limit resets from ratelimit header and waits exactly the time needed before retrying. This will be shipped in the next release!
cc @Weyaxi for visibility since you added the original retry mechanism in pagination in #2970 🤗 btw, if you're hitting rate limits frequently, you can get much higher limits with a PRO subscription (12K resolver calls and 2.5K API calls per minute instead of 5k and 1k respectively), you can find more info in the docs here