Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65c7e62

Browse files
fix: support RateLimit-Reset header
Some endpoints are not returning the `Retry-After` header whenrate-limiting occurrs. In those cases use the `RateLimit-Reset`header, if available.Closes:#1889
1 parent85a734f commit65c7e62

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎gitlab/client.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ def http_request(
704704
wait_time=2**cur_retries*0.1
705705
if"Retry-After"inresult.headers:
706706
wait_time=int(result.headers["Retry-After"])
707+
elif"RateLimit-Reset"inresult.headers:
708+
wait_time=int(result.headers["RateLimit-Reset"])-time.time()
707709
cur_retries+=1
708710
time.sleep(wait_time)
709711
continue

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp