Ver Fonte

Fixes to allow for chord callbacks in always_eager mode

Grant Thomas há 13 anos atrás
pai
commit
638db5c8e9
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      celery/task/chords.py

+ 5 - 2
celery/task/chords.py

@@ -60,6 +60,9 @@ class chord(object):
 
     def __call__(self, body, **options):
         tid = body.options.setdefault("task_id", uuid())
-        self.Chord.apply_async((list(self.tasks), body), self.options,
+        taskset_result = self.Chord.apply_async((list(self.tasks), body), self.options,
                                 **options)
-        return body.type.app.AsyncResult(tid)
+
+        if self.Chord.app.conf.CELERY_ALWAYS_EAGER:
+            return subtask(body).apply(args=(taskset_result.result.join(),))
+        return body.type.AsyncResult(tid)