Explorar el Código

Close TaskConsumer on reset_connection.

Ask Solem hace 16 años
padre
commit
98137ba36d
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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):