summaryrefslogtreecommitdiff
path: root/kafka/coordinator/consumer.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2017-03-13 16:39:23 -0700
committerGitHub <noreply@github.com>2017-03-13 16:39:23 -0700
commit195df5fb9895ec78cd5e25eda30cbec201b4ab4f (patch)
treec990ee1bd0b864a0c1fd92b0b47108ff3b1badab /kafka/coordinator/consumer.py
parentce57dac0c6c620371a1c484b9619e2deb83be82e (diff)
downloadkafka-python-195df5fb9895ec78cd5e25eda30cbec201b4ab4f.tar.gz
Optionally skip auto-commit during consumer.close (#1031)
Diffstat (limited to 'kafka/coordinator/consumer.py')
-rw-r--r--kafka/coordinator/consumer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kafka/coordinator/consumer.py b/kafka/coordinator/consumer.py
index fac8144..fdbb995 100644
--- a/kafka/coordinator/consumer.py
+++ b/kafka/coordinator/consumer.py
@@ -325,9 +325,10 @@ class ConsumerCoordinator(BaseCoordinator):
time.sleep(self.config['retry_backoff_ms'] / 1000.0)
- def close(self):
+ def close(self, autocommit=True):
try:
- self._maybe_auto_commit_offsets_sync()
+ if autocommit:
+ self._maybe_auto_commit_offsets_sync()
finally:
super(ConsumerCoordinator, self).close()