Skip to content

Commit 13d0d44

Browse files
committed
Merge pull request dpkp#148 from wizzat/seek_commit
Make seek(); commit(); work without commit discarding the seek change
2 parents 9bed11d + 7d425d0 commit 13d0d44

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kafka/consumer.py

+4
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ def seek(self, offset, whence):
305305

306306
# Reset queue and fetch offsets since they are invalid
307307
self.fetch_offsets = self.offsets.copy()
308+
if self.auto_commit:
309+
self.count_since_commit += 1
310+
self.commit()
311+
308312
self.queue = Queue()
309313

310314
def get_messages(self, count=1, block=True, timeout=0.1):

0 commit comments

Comments
 (0)