diff options
| author | Enrico Canzonieri <ecanzonieri@gmail.com> | 2015-03-20 15:29:19 -0700 |
|---|---|---|
| committer | Enrico Canzonieri <ecanzonieri@gmail.com> | 2015-03-20 15:29:19 -0700 |
| commit | a049e19a1b3220d8eb85e380a564942e02543ef5 (patch) | |
| tree | c3cfde290fac486c52e4152be8a9ac666c5bcb23 /kafka/consumer/simple.py | |
| parent | a5b1c8d0fc627de228d00db25ad27fa078c9da32 (diff) | |
| download | kafka-python-a049e19a1b3220d8eb85e380a564942e02543ef5.tar.gz | |
Increase count_since_commit on seek
When auto_commit is False this change enables an explicit call to
commit() to actually commit the offsets. Otherwise a consumer won't be
able to commit until at least one message is read.
Diffstat (limited to 'kafka/consumer/simple.py')
| -rw-r--r-- | kafka/consumer/simple.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kafka/consumer/simple.py b/kafka/consumer/simple.py index 3d250ea..b50de61 100644 --- a/kafka/consumer/simple.py +++ b/kafka/consumer/simple.py @@ -214,8 +214,8 @@ class SimpleConsumer(Consumer): # Reset queue and fetch offsets since they are invalid self.fetch_offsets = self.offsets.copy() + self.count_since_commit += 1 if self.auto_commit: - self.count_since_commit += 1 self.commit() self.queue = Queue() |
