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