Skip to content

Commit 1b9ba31

Browse files
committed
Fix ZeroDivisionError in ratelimit logic
1 parent 2cedf58 commit 1b9ba31

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

troi/http_request.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ def http_fetch(url, method, headers=None, params=None, **kwargs):
7070
else:
7171
time_left = reset - time()
7272

73+
if remaining == 0:
74+
remaining = 1
75+
7376
if time_left > 0:
7477
time_to_wait = time_left / remaining
7578
sleep(time_to_wait)

0 commit comments

Comments
 (0)