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

Appearance settings

Commit 6470802

Browse filesBrowse files
committed
fix(utils): prevent negative sleep time in rate limit retry
1 parent 16fa4b8 commit 6470802
Copy full SHA for 6470802

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎gitlab/utils.py‎

Copy file name to clipboardExpand all lines: gitlab/utils.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def handle_retry_on_status(
133133
if "Retry-After" in headers:
134134
wait_time = int(headers["Retry-After"])
135135
elif "RateLimit-Reset" in headers:
136-
wait_time = int(headers["RateLimit-Reset"]) - time.time()
136+
wait_time = max(0, int(headers["RateLimit-Reset"]) - time.time())
137137
self.cur_retries += 1
138138
time.sleep(wait_time)
139139
return True

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.