Skip to content

Commit

Permalink
fix time evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Apr 24, 2024
1 parent 051ac89 commit 75fac4a
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 @@ -122,7 +122,7 @@ async def proxy():
headers = {'Authorization': f'token {token}'}

if cached_resp and "etag" in cached_resp:
if current_time - last_checked >= 60:
if "last_checked" in cached_resp and current_time - last_checked < 60:
logger.info(f"Using cached data for URL: {url_to_fetch}")
return jsonify(json.loads(cached_resp["data"]))
else:
Expand Down

0 comments on commit 75fac4a

Please sign in to comment.