Cache prefetch
This commit is contained in:
parent
c2f6dba462
commit
2831a24b90
6 changed files with 70 additions and 34 deletions
|
@ -74,7 +74,17 @@ def cache_wrapper(prefix, timeout=None):
|
|||
if l0_cache:
|
||||
l0_cache.delete(cache_key)
|
||||
|
||||
def prefetch_multi(args_list):
|
||||
keys = []
|
||||
for args in args_list:
|
||||
keys.append(get_key(func, *args))
|
||||
results = cache.get_many(keys)
|
||||
for key, result in results.items():
|
||||
if result is not None:
|
||||
_set_l0(key, result)
|
||||
|
||||
wrapper.dirty = dirty
|
||||
wrapper.prefetch_multi = prefetch_multi
|
||||
|
||||
return wrapper
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue