Replies: 1 comment
|
Yes—wait on the task handle returned by from taskiq.exceptions import TaskiqResultTimeoutError
task = await send_broadcast_message.kiq(*args)
try:
result = await task.wait_result(timeout=300)
except TaskiqResultTimeoutError:
# No final result arrived within this client's wait limit.
# This does not cancel the worker or prove retries are exhausted.
raise
else:
result.raise_for_error() # raises the error stored in the result
value = result.return_valueConfigure the same persistent result backend on the producer and workers. With Allow enough timeout for execution plus retry delays. Exception reconstruction also depends on the serializer and exception type; don't assume the original worker traceback is preserved. Source: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi! 👋
I'm using
SmartRetryMiddlewarewithretry_on_error=True. I don't really unserstand the thing:My goal is to catch the final exception in the calling code, but after the final retry, the original exception is not propagated back. Should I use
task.wait_result()?All reactions