Browse Source

Close TaskConsumer on reset_connection.

Ask Solem 16 năm trước cách đây
mục cha
commit
98137ba36d
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      celery/worker.py

+ 2 - 0
celery/worker.py

@@ -98,6 +98,8 @@ class TaskDaemon(object):
         self.reset_connection()
 
     def reset_connection(self):
+        if hasattr(self, "task_consumer"):
+            self.task_consumer.close()
         self.task_consumer = TaskConsumer(connection=DjangoAMQPConnection())
 
     def connection_diagnostics(self):