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

Add support for having no expiry on a cache region. #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add support for having no expiry on a cache region. #21

wants to merge 3 commits into from

Conversation

TimDumol
Copy link

Right now setting e.g., cache.expire = None results in an exception because it's interpreted as a string. This fixes it.

@@ -165,6 +167,8 @@ def set_cache_regions_from_settings(settings):
for key in list(cache_settings.keys()):
if key.startswith(region_prefix):
region_settings[key[region_len:]] = cache_settings.pop(key)
if region_settings['expire'] == 'None':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is to be added it should be a little more lenient than simply passing None. At least make it case-insensitive, but perhaps also accept no.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I also added a unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants