Add more details on rate limit logs
@@ -18,9 +18,11 @@ def wrapper(*args, **kwargs):
raise e
delay = int(e.response.headers.get("Retry-After", 1))
- logging.warning('RateLimitException, retrying after {} seconds'.format(delay))
- sleep(delay)
retry += 1
+ logging.warning(
+ f'RateLimitException for {fn}, retrying after {delay} seconds (try: {retry}/{retries})'
+ )
+ sleep(delay)
return wrapper
