redis fixes

This commit is contained in:
msramalho
2023-02-25 13:19:42 +01:00
parent 570c0c2abe
commit 6b4dd9c0a9
5 changed files with 9 additions and 4 deletions

View File

@@ -58,8 +58,8 @@ def get_status(task_id, access_token:str):
"task_result": task_result.result
}
try:
json_result = jsonable_encoder(result)
# json_result = jsonable_encoder(result, custom_encoder=pydantic_encoder) # causes error
json_result = jsonable_encoder(result, exclude_unset=True)
# json_result = jsonable_encoder(result, custom_encoder={"pydantic_encoder": pydantic_encoder}) # causes error
return JSONResponse(json_result)
except Exception as e:
logger.error(e)
@@ -75,7 +75,7 @@ def get_status(task_id, access_token:str):
@app.get("/")
def home():
return JSONResponse({"message": "Hello"})
return JSONResponse({"status": "good", "version": "0.1.0"})
@app.on_event("startup")
async def on_startup():