Ver código fonte

Task methods now works with ALWAYS_EAGER. Closes #1478

Conflicts:
	celery/app/task.py
Ask Solem 11 anos atrás
pai
commit
a25a2706d4
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      celery/app/task.py

+ 4 - 3
celery/app/task.py

@@ -453,13 +453,14 @@ class Task(object):
         router = router or self.app.amqp.router
         conf = app.conf
 
+        if conf.CELERY_ALWAYS_EAGER:
+            return self.apply(args, kwargs, task_id=task_id,
+                              link=link, link_error=link_error, **options)
+
         # add 'self' if this is a bound method.
         if self.__self__ is not None:
             args = (self.__self__, ) + tuple(args)
 
-        if conf.CELERY_ALWAYS_EAGER:
-            return self.apply(args, kwargs, task_id=task_id,
-                              link=link, link_error=link_error, **options)
         options = dict(extract_exec_options(self), **options)
         options = router.route(options, self.name, args, kwargs)