Skip to content

Commit a306687

Browse files
committed
Merge pull request #77 from zever/timeout-none
allow for timeout to be None in SimpleConsumer.get_messages
2 parents 67c13f9 + 8d26368 commit a306687

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kafka/consumer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ def get_messages(self, count=1, block=True, timeout=0.1):
294294
iterator = self.__iter__()
295295

296296
# HACK: This splits the timeout between available partitions
297-
timeout = timeout * 1.0 / len(self.offsets)
297+
if timeout:
298+
timeout = timeout * 1.0 / len(self.offsets)
298299

299300
with FetchContext(self, block, timeout):
300301
while count > 0:

0 commit comments

Comments
 (0)