handle serialization of result more generically - if we cannot json dumps, then return string representation
This commit is contained in:
parent
a0d099e62b
commit
5a9a837b27
1 changed files with 3 additions and 2 deletions
|
|
@ -94,8 +94,9 @@ async def get_task_status(
|
|||
task_id: str,
|
||||
) -> dict[str, str]:
|
||||
task_result = listing_tasks.dump_listings_task.AsyncResult(task_id)
|
||||
result = task_result.result
|
||||
if type(task_result.result) is TaskRevokedError:
|
||||
try:
|
||||
result = json.dumps(task_result.result)
|
||||
except:
|
||||
result = str(task_result.result)
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue