Browse Source

celeryd_after_setup signal is now sent before the startup banner is printed

Ask Solem 13 years ago
parent
commit
dec34102e1
2 changed files with 6 additions and 4 deletions
  1. 2 0
      celery/app/control.py
  2. 4 4
      celery/apps/worker.py

+ 2 - 0
celery/app/control.py

@@ -174,6 +174,8 @@ class Control(object):
         :keyword exchange_type: Type of exchange (defaults to 'direct')
             command to, when empty broadcast to all workers.
         :keyword routing_key: Optional routing key.
+        :keyword options: Additional options as supported
+            by :meth:`kombu.entitiy.Queue.from_dict`.
 
         See :meth:`broadcast` for supported keyword arguments.
 

+ 4 - 4
celery/apps/worker.py

@@ -148,6 +148,10 @@ class Worker(configurated):
     def run(self):
         self.init_queues()
         self.app.loader.init_worker()
+        # this signal can be used to e.g. change queues after
+        # the -Q option has been applied.
+        signals.celeryd_after_setup.send(sender=self.hostname, instance=self,
+                                         conf=self.app.conf)
 
         if getattr(os, 'getuid', None) and os.getuid() == 0:
             warnings.warn(RuntimeWarning(
@@ -163,10 +167,6 @@ class Worker(configurated):
         self.set_process_status('-active-')
 
         self.redirect_stdouts_to_logger()
-        # this signal can be used to e.g. change queues after
-        # the -Q option has been applied.
-        signals.celeryd_after_setup.send(sender=self.hostname, instance=self,
-                                         conf=self.app.conf)
         try:
             self.run_worker()
         except IGNORE_ERRORS: