From 8a0928becace6b0bb3a73cebc17f592289a1b8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Tue, 31 Jul 2018 09:55:48 +0200 Subject: [PATCH] Fix RateLimiter semantics --- lib/tfw/decorators/rate_limiter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tfw/decorators/rate_limiter.py b/lib/tfw/decorators/rate_limiter.py index 134dd3e..0f7f20b 100644 --- a/lib/tfw/decorators/rate_limiter.py +++ b/lib/tfw/decorators/rate_limiter.py @@ -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