This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new ad19cd9fbd fix: timeout should be an integer (#23924)
ad19cd9fbd is described below
commit ad19cd9fbd1dd91f27b6871dff0e95453c3c97c7
Author: Beto Dealmeida <[email protected]>
AuthorDate: Wed May 3 13:33:00 2023 -0700
fix: timeout should be an integer (#23924)
---
superset/utils/cache.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/superset/utils/cache.py b/superset/utils/cache.py
index 442690b26c..a632b04b37 100644
--- a/superset/utils/cache.py
+++ b/superset/utils/cache.py
@@ -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