Skip to content

Commit

Permalink
Change min_cache_time to cache_time and make sure the value is always >0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyria committed Dec 25, 2017
1 parent 688db2e commit 943b16e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions esipy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ def __init__(self, **kwargs):
""" Constructor.
:param: cache if specified, use that cache, else use DictCache
:param: min_cache_time is the minimum cache time for versions
:param: cache_time is the minimum cache time for versions
endpoints. If set to 0, never expires". Default 86400sec (1day)
"""
min_cache_time = kwargs.pop('min_cache_time', 86400)
self.expire = None if min_cache_time == 0 else min_cache_time
cache_time = kwargs.pop('cache_time', 86400)
if cache_time == 0 or cache_time is None:
self.expire = None
else:
self.expire = cache_time if cache_time > 0 else 86400

self.cached_version = []

cache = kwargs.pop('cache', False)
Expand Down

0 comments on commit 943b16e

Please sign in to comment.