Skip to content

Commit

Permalink
reduce cache on election intersecting local auth query
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s authored and GeoWill committed Oct 25, 2024
1 parent ea93fa2 commit 8e853f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions polling_stations/apps/data_finder/helpers/every_election.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e853f4

Please sign in to comment.