From 8e853f40a1dc6ade2fac36b6fd9f463625a45b79 Mon Sep 17 00:00:00 2001 From: chris48s Date: Fri, 25 Oct 2024 10:15:27 +0100 Subject: [PATCH] reduce cache on election intersecting local auth query --- polling_stations/apps/data_finder/helpers/every_election.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/polling_stations/apps/data_finder/helpers/every_election.py b/polling_stations/apps/data_finder/helpers/every_election.py index 8867023094..c602bc7e2e 100644 --- a/polling_stations/apps/data_finder/helpers/every_election.py +++ b/polling_stations/apps/data_finder/helpers/every_election.py @@ -75,8 +75,9 @@ def get_election_intersecting_local_authority(self, council_id): council_id, ) ) - # Only used by council users atm so seems safe to cache for a whole day - return self.get_data(query_url, cache_hours=24) + # Only used by council users in the uploader + # This query is expensive, so we want to avoid making it too often + return self.get_data(query_url, cache_hours=0.5) def get_data(self, query_url, cache_hours=0): res_json = None