Default stale=false; specific staleness parameters
This commit is contained in:
4
util.py
4
util.py
@@ -129,7 +129,7 @@ class CacheProxy(object):
|
||||
with cache:
|
||||
res = cache[_cache_key] = await value(*args, **kw)
|
||||
return res
|
||||
async def thunk(*args, _cache_ttl: float=ttl, _cache_stale: bool=True, **kw):
|
||||
async def thunk(*args, _cache_ttl: float=ttl, _cache_stale: bool=False, **kw):
|
||||
_cache_key = prefix + key + repr(args) + repr(kw)
|
||||
try:
|
||||
return cache[_cache_key:_cache_ttl]
|
||||
@@ -145,7 +145,7 @@ class CacheProxy(object):
|
||||
with lock, cache:
|
||||
res = cache[_cache_key] = value(*args, **kw)
|
||||
return res
|
||||
def thunk(*args, _cache_ttl: float=ttl, _cache_stale: bool=True, **kw):
|
||||
def thunk(*args, _cache_ttl: float=ttl, _cache_stale: bool=False, **kw):
|
||||
_cache_key = prefix + key + repr(args) + repr(kw)
|
||||
try:
|
||||
return cache[_cache_key:_cache_ttl]
|
||||
|
Reference in New Issue
Block a user