Closed martastain closed 1 month ago
Any reason you're not doing:
cached_result.get("result", EmptyResponse())
if for whatever the "result" is still empty in some other meaningful way?
Yep, you're right. I'll clean it up
Also, does
cached_result.get("result")
actually return aEnrollResponseModel
? Because it seems to just be returning the JSON result fromRedis.get_json()
which looking at the code seems toreturn json_loads
for example?
Fastapi really doesn't care here. The result from orjson.loads is a plain dict, but it will work as long as it matches the response model.
This pull request includes a small but important change to the enroll endpoint. The change ensures that an
EmptyResponse
is returned if the cached result is not available.