Bläddra i källkod

Close TaskConsumer on reset_connection.

Ask Solem 16 år sedan
förälder
incheckning
98137ba36d
1 ändrade filer med 2 tillägg och 0 borttagningar
  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):