From 5a9a837b2759e5c785aa3b4439c4fcef8aa13f3e Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Mon, 23 Jun 2025 19:45:31 +0000 Subject: [PATCH] handle serialization of result more generically - if we cannot json dumps, then return string representation --- crawler/api/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crawler/api/app.py b/crawler/api/app.py index 8c7db71..688ad13 100644 --- a/crawler/api/app.py +++ b/crawler/api/app.py @@ -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 {