소스 검색

Reuse channel when sending remote control commands

Ask Solem 13 년 전
부모
커밋
8a3ed48a5b
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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,