Fix used same variable name triggered reading var before setting
continuous-integration/drone/push Build is passing Details

master
Felix Stupp 3 years ago
parent 8303afbec3
commit a4c464decb
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -92,14 +92,14 @@ class ApplicationCache():
def cache_anything(self, key_prefix: str = None, max_age: int = None, packer = IDENTITY, unpacker = IDENTITY):
def decorator(fun):
key_prefix = key_prefix or fun.__name__
cache_prefix = key_prefix or fun.__name__
@wraps(fun)
def decorated(*args, no_cache: bool = False, cache_no_lookup: bool = False, cache_no_store: bool = False, **kwargs):
cache_no_lookup = no_cache or cache_no_lookup
cache_no_store = no_cache or cache_no_store
no_cache_key = cache_no_lookup and cache_no_store
if not no_cache_key:
cache_key = self.gen_key(key_prefix, args, kwargs)
cache_key = self.gen_key(cache_prefix, args, kwargs)
if not cache_no_lookup:
cached_data = self.load(key=cache_key, max_age=max_age)
if cached_data is not None:

Loading…
Cancel
Save