This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tldr: Retry the request until you got a non-error response. | |
# In my own experience, in less than 40 attempts you can get a non-error response. | |
# For the customer API (Python): | |
response = api_call(...)['response'] | |
response_status = response.get('status') | |
attempts = 0 | |
while response_status == 429 and attempts < max_attempts: | |
response = api_call(...)['response'] |
OlderNewer