Ver Fonte

Reuse channel when sending remote control commands

Ask Solem há 13 anos atrás
pai
commit
8a3ed48a5b
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      celery/task/control.py

+ 4 - 0
celery/task/control.py

@@ -208,6 +208,10 @@ class Control(object):
 
         """
         with self.app.default_connection(connection, connect_timeout) as conn:
+            if channel is None:
+                if not getattr(conn, "_publisher_chan", None):
+                    conn._publisher_chan = conn.channel()
+                channel = conn._publisher_chan
             return self.mailbox(conn)._broadcast(command, arguments,
                                                  destination, reply, timeout,
                                                  limit, callback,