Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
reduce cache size (#21)
  • Loading branch information
Kilo59 committed May 3, 2020
commit 6e5bf9fa4cc5715d2ffe6810b1fd60e15ed19e12
4 changes: 2 additions & 2 deletions app/services/location/jhu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/services/location/nyt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down