mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
* First cut at app factory * Setting things back to master * Working with new FLASK_APP * Still need to refactor Celery * CLI mostly working * Working on unit tests * Moving cli stuff around a bit * Removing get in config * Defaulting test config * Adding flask-testing * flask-testing casing * resultsbackend property bug * Fixing up cli * Quick fix for KV api * Working on save slice * Fixed core_tests * Fixed utils_tests * Most tests working - still need to dig into remaining app_context issue in tests * All tests passing locally - need to update code comments * Fixing dashboard tests again * Blacking * Sorting imports * linting * removing envvar mangling * blacking * Fixing unit tests * isorting * licensing * fixing mysql tests * fixing cypress? * fixing .flaskenv * fixing test app_ctx * fixing cypress * moving manifest processor around * moving results backend manager around * Cleaning up __init__ a bit more * Addressing PR comments * Addressing PR comments * Blacking * Fixes for running celery worker * Tuning isort * Blacking
This commit is contained in:
committed by
Daniel Vaz Gaspar
parent
300c4ecb0f
commit
e490414484
@@ -15,9 +15,12 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# pylint: disable=C,R,W
|
||||
from flask import request
|
||||
from typing import Optional
|
||||
|
||||
from superset import tables_cache
|
||||
from flask import Flask, request
|
||||
from flask_caching import Cache
|
||||
|
||||
from superset.extensions import cache_manager
|
||||
|
||||
|
||||
def view_cache_key(*unused_args, **unused_kwargs) -> str:
|
||||
@@ -43,7 +46,7 @@ def memoized_func(key=view_cache_key, attribute_in_key=None):
|
||||
"""
|
||||
|
||||
def wrap(f):
|
||||
if tables_cache:
|
||||
if cache_manager.tables_cache:
|
||||
|
||||
def wrapped_f(self, *args, **kwargs):
|
||||
if not kwargs.get("cache", True):
|
||||
@@ -55,11 +58,13 @@ def memoized_func(key=view_cache_key, attribute_in_key=None):
|
||||
)
|
||||
else:
|
||||
cache_key = key(*args, **kwargs)
|
||||
o = tables_cache.get(cache_key)
|
||||
o = cache_manager.tables_cache.get(cache_key)
|
||||
if not kwargs.get("force") and o is not None:
|
||||
return o
|
||||
o = f(self, *args, **kwargs)
|
||||
tables_cache.set(cache_key, o, timeout=kwargs.get("cache_timeout"))
|
||||
cache_manager.tables_cache.set(
|
||||
cache_key, o, timeout=kwargs.get("cache_timeout")
|
||||
)
|
||||
return o
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user