Skip to content

Commit

Permalink
use json.loads when updating cache
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Apr 24, 2024
1 parent 6c26f87 commit e01948a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async def proxy():

if response.status_code == 304:
logger.info(f"Using cached data for URL: {url_to_fetch}")
await set_to_cache(url_to_fetch, cached_resp["data"], cached_resp["etag"])
await set_to_cache(url_to_fetch, json.loads(cached_resp["data"]), cached_resp["etag"])
return jsonify(json.loads(cached_resp["data"]))
elif response.status_code == 200:
await set_to_cache(url_to_fetch, response.json(), response.headers.get('ETag', ''))
Expand Down

0 comments on commit e01948a

Please sign in to comment.