Skip to content

Commit 37a1ad0

Browse files
authored
reduce cache maxsize (#20) (#308)
1 parent 983fa5c commit 37a1ad0

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,10 +46,10 @@ async def get(self, loc_id): # pylint: disable=arguments-differ
4646
)
4747

4848

49-
@cached(cache=TTLCache(maxsize=1024, ttl=1800))
49+
@cached(cache=TTLCache(maxsize=128, ttl=1800))
5050
async def get_category(category):
5151
"""
52-
Retrieves the data for the provided category. The data is cached for 1 hour.
52+
Retrieves the data for the provided category. The data is cached for 30 minutes locally, 1 hour via shared Redis.
5353
5454
:returns: The data for category.
5555
:rtype: dict

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=1024, ttl=3600))
69+
@cached(cache=TTLCache(maxsize=128, 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)