Преглед на файлове

routes: Values defined in the route should have precedence over values defined in CELERY_QUEUES.

This was not true, but the other way around instead.

If you had the following config:

CELERY_QUEUES = {"cpu-bound": {"routing_key": "tasks.cpu",
                               "exchange": "cpu-bound"}}

CELERY_ROUTES = {"tasks.add": {"routing_key": "tasks.cpu.add"}}

In this case the final routing key would be "tasks.cpu".
With this change the values in the route will be more important when the
values are merged, so the final options will become:

{"routing_key": "tasks.cpu.add",
 "exchange": "cpu-bound"}

Closes #177. Thanks to molotov.
Ask Solem преди 14 години
родител
ревизия
d524e95078
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      celery/routes.py

+ 1 - 1
celery/routes.py

@@ -64,7 +64,7 @@ class Router(object):
                     raise QueueNotFound(
                         "Queue '%s' is not defined in CELERY_QUEUES" % queue)
             dest.setdefault("routing_key", dest.get("binding_key"))
-            return dict(route, **dest)
+            return dict(dest, **route)
 
         return route