mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 12:15:13 +00:00
Fix RateLimiter semantics
This commit is contained in:
@ -51,10 +51,10 @@ class RateLimiter:
|
||||
def _limit_rate(self):
|
||||
seconds_since_last_call = time() - self.last_call
|
||||
seconds_to_next_call = self.min_interval - seconds_since_last_call
|
||||
self.last_call = time()
|
||||
|
||||
if seconds_to_next_call > 0:
|
||||
return seconds_to_next_call
|
||||
self.last_call = time()
|
||||
return 0
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user