8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 363bc87 + 4060146 commit 114958eCopy full SHA for 114958e
gitlab/client.py
@@ -700,10 +700,14 @@ def http_request(
700
if (429 == result.status_code and obey_rate_limit) or (
701
result.status_code in [500, 502, 503, 504] and retry_transient_errors
702
):
703
+ # Response headers documentation:
704
+ # https://docs.gitlab.com/ee/user/admin_area/settings/user_and_ip_rate_limits.html#response-headers
705
if max_retries == -1 or cur_retries < max_retries:
706
wait_time = 2**cur_retries * 0.1
707
if "Retry-After" in result.headers:
708
wait_time = int(result.headers["Retry-After"])
709
+ elif "RateLimit-Reset" in result.headers:
710
+ wait_time = int(result.headers["RateLimit-Reset"]) - time.time()
711
cur_retries += 1
712
time.sleep(wait_time)
713
continue
0 commit comments