Pārlūkot izejas kodu

Reuse channel when sending remote control commands

Ask Solem 13 gadi atpakaļ
vecāks
revīzija
8a3ed48a5b
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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,