don't cache errors

This commit is contained in:
thatmattlove 2024-06-30 21:34:42 -04:00
parent 0fd5bc7997
commit 3b0abd5ba8

View file

@ -138,6 +138,8 @@ async def query(_state: HyperglassState, request: Request, data: Query) -> Query
response_format = "text/plain"
if json_output:
if cache_response.get("level") != "success":
cache.delete(cache_key)
response_format = "application/json"
_log.info("Execution completed")