summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Widman <jeff@jeffwidman.com>2019-05-29 21:49:08 -0700
committerJeff Widman <jeff@jeffwidman.com>2019-05-30 13:12:39 -0700
commit79dd508b14fd2d66a8b6d32353e8e64989c4ff84 (patch)
treeb2ed93cdc5e05abaeb302b1f6dfa3ac87984e5c3
parent9f0b518286ecfc6db8b7abbd2431810c16f1cc80 (diff)
downloadkafka-python-79dd508b14fd2d66a8b6d32353e8e64989c4ff84.tar.gz
Delay converting to seconds
Delaying the conversion to seconds makes the code intent more clear.
-rw-r--r--kafka/client_async.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kafka/client_async.py b/kafka/client_async.py
index 42ec42b..96c0647 100644
--- a/kafka/client_async.py
+++ b/kafka/client_async.py
@@ -591,9 +591,9 @@ class KafkaClient(object):
# if there are no requests in flight, do not block longer than the retry backoff
if self.in_flight_request_count() == 0:
timeout = min(timeout, self.config['retry_backoff_ms'])
- timeout = max(0, timeout / 1000) # avoid negative timeouts
+ timeout = max(0, timeout) # avoid negative timeouts
- self._poll(timeout)
+ self._poll(timeout / 1000)
responses.extend(self._fire_pending_completed_requests())