Explorar el Código

prevent consuming queue before ready on startup (#3752)

Alan Hamlett hace 8 años
padre
commit
4d63867c82
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      celery/worker/loops.py

+ 2 - 2
celery/worker/loops.py

@@ -44,10 +44,10 @@ def asynloop(obj, connection, consumer, blueprint, hub, qos,
     _enable_amqheartbeats(hub.timer, connection, rate=hbrate)
 
     consumer.on_message = on_task_received
-    consumer.consume()
-    obj.on_ready()
     obj.controller.register_with_event_loop(hub)
     obj.register_with_event_loop(hub)
+    consumer.consume()
+    obj.on_ready()
 
     # did_start_ok will verify that pool processes were able to start,
     # but this will only work the first time we start, as