When a Celery task fails, `result.ready()` evaluates to `True` but `result.successful()` is `False`. Calling `result.get()` without `propagate=False` on a failed task will re-raise the task's exception, causing the Flask endpoint to crash with a 500 Internal Server Error instead of returning the task's failed status. Additionally, if `result.result` is an Exception object, returning it directly in the dictionary will cause a `TypeError` during JSON serialization. Affected files: views.py Signed-off-by: Tang Vu <vuminhtang2212@gmail.com> |
||
|---|---|---|
| .. | ||
| celery | ||
| javascript | ||
| tutorial | ||