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.
This commit is contained in:
Lilia Kai
2023-09-06 15:54:32 +02:00
parent 1b39f2c291
commit 00201770ba

View File

@@ -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})