From c6e8322b77d4945467cd6f66f915a9055492d744 Mon Sep 17 00:00:00 2001 From: fmk17 <fmk17@inf.ufpr.br> Date: Thu, 10 Feb 2022 10:05:58 -0300 Subject: [PATCH] Fix crawler cache --- crawler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawler.py b/crawler.py index 0cb26de..9a74b31 100644 --- a/crawler.py +++ b/crawler.py @@ -27,7 +27,7 @@ def get_menus_by_days(location: Location): global cached_responses global cached_update_times - if location in cached_update_times and cached_update_times[location] < datetime.now() + timedelta(minutes=5): + if location in cached_update_times and cached_update_times[location] + timedelta(minutes=5) > datetime.now(): return (cached_responses[location], cached_update_times[location]) response = requests.get(location.value) -- GitLab