From 00201770ba6c3d63f41485f7359ad4c72df4d992 Mon Sep 17 00:00:00 2001 From: Lilia Kai Date: Wed, 6 Sep 2023 15:54:32 +0200 Subject: [PATCH] Create archive task returns dict instead of string This will save the task result in redis as a json object instead of a json-encoded string. This makes for a nicer response from get_status and prevents the client having to parse a json string to work with the result. --- src/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker.py b/src/worker.py index 90ab531..8e2d8a7 100644 --- a/src/worker.py +++ b/src/worker.py @@ -43,7 +43,7 @@ def create_archive_task(self, archive_json: str): logger.error(e) logger.error(traceback.format_exc()) return {"error": e} - return result.to_json() + return result.to_dict() @celery.task(name="create_sheet_task", bind=True, autoretry_for=(Exception,), retry_backoff=True, retry_kwargs={'max_retries': 0})