소스 검색

Disable events completely if without-gossip+without-heartbeat. Closes #2483

Ask Solem 9 년 전
부모
커밋
c136e7f0cb
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      celery/worker/consumer.py

+ 7 - 2
celery/worker/consumer.py

@@ -542,9 +542,14 @@ class Connection(bootsteps.StartStopStep):
 class Events(bootsteps.StartStopStep):
     requires = (Connection,)
 
-    def __init__(self, c, send_events=None, **kwargs):
-        self.send_events = True
+    def __init__(self, c, send_events=True,
+                 without_heartbeat=False, without_gossip=False, **kwargs):
         self.groups = None if send_events else ['worker']
+        self.send_events = (
+            send_events or
+            not without_gossip or
+            not without_heartbeat
+        )
         c.event_dispatcher = None
 
     def start(self, c):