Skip to content

Commit bb68965

Browse files
author
Dana Powers
committed
Stop consumers on delete
1 parent fd204dc commit bb68965

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)