Parcourir la source

Reuse channel when sending remote control commands

Ask Solem il y a 14 ans
Parent
commit
8a3ed48a5b
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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,