浏览代码

Close TaskConsumer on reset_connection.

Ask Solem 16 年之前
父节点
当前提交
98137ba36d
共有 1 个文件被更改,包括 2 次插入0 次删除
  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):