Browse Source

Forgot to commit

Ask Solem 12 years ago
parent
commit
d6267d9910
2 changed files with 9 additions and 7 deletions
  1. 6 3
      celery/app/builtins.py
  2. 3 4
      celery/result.py

+ 6 - 3
celery/app/builtins.py

@@ -98,10 +98,13 @@ def add_unlock_chord_task(app):
             try:
                 ret = j(propagate=propagate)
             except Exception, exc:
-                culprit = deps._failed_join_report().next()
+                try:
+                    culprit = deps._failed_join_report().next()
+                    reason = 'Dependency %s raised %r' % (culprit.id, exc)
+                except StopIteration:
+                    reason = repr(exc)
                 app._tasks[callback.task].backend.fail_from_current_stack(
-                    callback.id, exc=ChordError('Dependency %s raised %r' % (
-                        culprit.id, exc)),
+                    callback.id, exc=ChordError(reason),
                 )
             else:
                 try:

+ 3 - 4
celery/result.py

@@ -525,10 +525,9 @@ class ResultSet(ResultBase):
         return acc
 
     def _failed_join_report(self):
-        for res in self.results:
-            if (res.backend.is_cached(res.id) and
-                    res.state in states.PROPAGATE_STATES):
-                yield res
+        return (res for res in self.results
+                if res.backend.is_cached(res.id) and
+                res.state in states.PROPAGATE_STATES)
 
     def __len__(self):
         return len(self.results)