fix(cache): respect default cache timeout on v1 chart data requests (#21441)

This commit is contained in:
Ville Brofeldt
2022-09-13 15:56:04 +02:00
committed by GitHub
parent eb4ba5b089
commit 05b97fff4d
5 changed files with 77 additions and 4 deletions

View File

@@ -434,6 +434,12 @@ class QueryContextProcessor:
cache_timeout_rv = self._query_context.get_cache_timeout()
if cache_timeout_rv:
return cache_timeout_rv
if (
data_cache_timeout := config["DATA_CACHE_CONFIG"].get(
"CACHE_DEFAULT_TIMEOUT"
)
) is not None:
return data_cache_timeout
return config["CACHE_DEFAULT_TIMEOUT"]
def cache_key(self, **extra: Any) -> str: