From d63c310193985e29c976f5a59f43c6ba78b8e3e6 Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Fri, 1 Sep 2023 16:50:52 -0300 Subject: [PATCH] Caching: Set cache filename to appname --- grafana_wtf/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grafana_wtf/core.py b/grafana_wtf/core.py index 1a6455d..8bacf5d 100644 --- a/grafana_wtf/core.py +++ b/grafana_wtf/core.py @@ -20,6 +20,7 @@ from tqdm.contrib.logging import tqdm_logging_redirect from urllib3.exceptions import InsecureRequestWarning +from grafana_wtf import __appname__ from grafana_wtf.model import ( DashboardDetails, DashboardExplorationItem, @@ -55,7 +56,7 @@ def enable_cache(self, expire_after=60, drop_cache=False): log.info(f"Response cache will expire immediately (expire_after=0)") else: log.info(f"Response cache will expire after {expire_after} seconds") - requests_cache.install_cache(expire_after=expire_after, use_cache_dir=True) + requests_cache.install_cache(cache_name=__appname__, expire_after=expire_after, use_cache_dir=True) cache_database_file = requests_cache.get_cache().db_path log.info(f"Response cache database location is {cache_database_file}") if drop_cache: @@ -525,7 +526,6 @@ def add(item): items.append(item) for node in element: - # Directly defined datasources. if "datasource" in node and node["datasource"]: ds = node.datasource