You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: