We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70e8608 commit 1c21959Copy full SHA for 1c21959
kafka/conn.py
@@ -865,7 +865,12 @@ def throttle_delay(self):
865
Return the number of milliseconds to wait until connection is no longer throttled.
866
"""
867
if self._throttle_time is not None:
868
- return max(0, time.time() - self._throttle_time) * 1000
+ remaining_ms = (self._throttle_time - time.time()) * 1000
869
+ if remaining_ms > 0:
870
+ return remaining_ms
871
+ else:
872
+ self._throttle_time = None
873
+ return 0
874
return 0
875
876
def connection_delay(self):
0 commit comments