diff options
author | Dana Powers <dana.powers@gmail.com> | 2017-03-13 16:39:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 16:39:23 -0700 |
commit | 195df5fb9895ec78cd5e25eda30cbec201b4ab4f (patch) | |
tree | c990ee1bd0b864a0c1fd92b0b47108ff3b1badab /kafka/coordinator/consumer.py | |
parent | ce57dac0c6c620371a1c484b9619e2deb83be82e (diff) | |
download | kafka-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.py | 5 |
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() |