Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce cache size #21

Merged
merged 1 commit into from
May 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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