From 7e35188f5a6f2c5c6bf244a07f10c3b7587dca3c Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sat, 2 May 2020 11:03:52 -0400 Subject: [PATCH] reduce cache size --- app/services/location/jhu.py | 4 ++-- app/services/location/nyt.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/location/jhu.py b/app/services/location/jhu.py index 1a11e8ac..07919cfe 100644 --- a/app/services/location/jhu.py +++ b/app/services/location/jhu.py @@ -46,7 +46,7 @@ async def get(self, loc_id): # pylint: disable=arguments-differ ) -@cached(cache=TTLCache(maxsize=128, ttl=1800)) +@cached(cache=TTLCache(maxsize=32, ttl=1800)) async def get_category(category): """ Retrieves the data for the provided category. The data is cached for 30 minutes locally, 1 hour via shared Redis. @@ -129,7 +129,7 @@ async def get_category(category): return results -@cached(cache=TTLCache(maxsize=1024, ttl=1800)) +@cached(cache=TTLCache(maxsize=1, ttl=1800)) async def get_locations(): """ Retrieves the locations from the categories. The locations are cached for 1 hour. diff --git a/app/services/location/nyt.py b/app/services/location/nyt.py index 8b70c5cc..3c092500 100644 --- a/app/services/location/nyt.py +++ b/app/services/location/nyt.py @@ -66,7 +66,7 @@ def get_grouped_locations_dict(data): return grouped_locations -@cached(cache=TTLCache(maxsize=128, ttl=3600)) +@cached(cache=TTLCache(maxsize=1, ttl=3600)) async def get_locations(): """ Returns a list containing parsed NYT data by US county. The data is cached for 1 hour.