Explorar o código

Result: Failed result should call promise on_error callback.

Ask Solem %!s(int64=8) %!d(string=hai) anos
pai
achega
901936cf24
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      celery/result.py

+ 4 - 1
celery/result.py

@@ -360,7 +360,10 @@ class AsyncResult(ResultBase):
             state = meta['status']
             if state in states.READY_STATES:
                 d = self._set_cache(self.backend.meta_from_decoded(meta))
-                self.on_ready(self)
+                if state in states.EXCEPTION_STATES:
+                    self.throw(self.result, propagate=False)
+                else:
+                    self.on_ready(self)
                 return d
         return meta