Open
Description
def wrapper(*args, **kwargs):
"""The actual wrapper"""
nonlocal hits, misses
key = make_key(args, kwargs)
value = cache.get(key, sentinel)
if value is not sentinel and values_toolkit.is_cache_value_valid(value):
with lock:
hits += 1
return values_toolkit.retrieve_result_from_cache_value(value)
else:
with lock:
misses += 1
result = user_function(*args, **kwargs)
cache[key] = values_toolkit.make_cache_value(result, ttl)
key_argument_map[key] = (args, kwargs)
return result
cache.get
fails on exception in hash_ function of one of the args.
Why does it cause the entire function to fail?
Why there is no try..catch around it?
Metadata
Metadata
Assignees
Labels
No labels