fix: timeout should be an integer (#23924)
This commit is contained in:
parent
842659dbfe
commit
ad19cd9fbd
|
|
@ -95,8 +95,7 @@ def view_cache_key(*args: Any, **kwargs: Any) -> str: # pylint: disable=unused-
|
|||
|
||||
|
||||
def memoized_func(
|
||||
key: Optional[str] = None,
|
||||
cache: Cache = cache_manager.cache,
|
||||
key: Optional[str] = None, cache: Cache = cache_manager.cache
|
||||
) -> Callable[..., Any]:
|
||||
"""
|
||||
Decorator with configurable key and cache backend.
|
||||
|
|
@ -143,7 +142,7 @@ def memoized_func(
|
|||
if not kwargs.get("force") and obj is not None:
|
||||
return obj
|
||||
obj = f(*args, **kwargs)
|
||||
cache.set(cache_key, obj, timeout=kwargs.get("cache_timeout"))
|
||||
cache.set(cache_key, obj, timeout=kwargs.get("cache_timeout", 0))
|
||||
return obj
|
||||
|
||||
return wrapped_f
|
||||
|
|
|
|||
Loading…
Reference in New Issue