handle serialization of result more generically - if we cannot json dumps, then return string representation

This commit is contained in:
Viktor Barzin 2025-06-23 19:45:31 +00:00
parent a0d099e62b
commit 5a9a837b27
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863

View file

@ -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 {