Skip to content

Commit 6e5bf9f

Browse files
committed
reduce cache size (#21)
1 parent 160c40e commit 6e5bf9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/services/location/jhu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def get(self, loc_id): # pylint: disable=arguments-differ
4646
)
4747

4848

49-
@cached(cache=TTLCache(maxsize=128, ttl=1800))
49+
@cached(cache=TTLCache(maxsize=32, ttl=1800))
5050
async def get_category(category):
5151
"""
5252
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):
129129
return results
130130

131131

132-
@cached(cache=TTLCache(maxsize=1024, ttl=1800))
132+
@cached(cache=TTLCache(maxsize=1, ttl=1800))
133133
async def get_locations():
134134
"""
135135
Retrieves the locations from the categories. The locations are cached for 1 hour.

app/services/location/nyt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_grouped_locations_dict(data):
6666
return grouped_locations
6767

6868

69-
@cached(cache=TTLCache(maxsize=128, ttl=3600))
69+
@cached(cache=TTLCache(maxsize=1, ttl=3600))
7070
async def get_locations():
7171
"""
7272
Returns a list containing parsed NYT data by US county. The data is cached for 1 hour.

0 commit comments

Comments
 (0)