Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions ratelimit/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ def wrapper(*args, **kargs):
:param args: non-keyword variable length argument list to the decorated function.
:param kargs: keyworded variable length argument list to the decorated function.
'''
while True:
try:
return func(*args, **kargs)
except RateLimitException as exception:
time.sleep(exception.period_remaining)
try:
return func(*args, **kargs)
except RateLimitException as exception:
threading.Timer(exception.period_remaining, func, *args, **kargs).start()
return wrapper