Use incremental backoff for other exceptions than RateLimitException
@@ -24,7 +24,10 @@ def wrapper(*args, **kwargs):
if retry == retries:
raise e
+ if isinstance(e, RateLimitException):
seconds = int(e.response.headers.get("Retry-After", 1))
+ else:
+ seconds = 1 + retry
retry += 1
logger.warning(
f"{e} for {fn}, retrying after {seconds} seconds (try: {retry}/{retries})"
