Skip to content

Commit d05fccb

Browse files
committed
Merge pull request #357 from dpkp/del_consumer_stop
Stop consumers on delete
2 parents bb1c11e + bb68965 commit d05fccb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kafka/consumer/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ def _auto_commit(self):
143143
if self.count_since_commit >= self.auto_commit_every_n:
144144
self.commit()
145145

146+
def __del__(self):
147+
self.stop()
148+
146149
def stop(self):
147150
if self.commit_timer is not None:
148151
self.commit_timer.stop()

0 commit comments

Comments
 (0)