aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorAlexander Kabui2021-11-17 08:13:41 +0300
committerAlexander Kabui2021-11-17 08:13:41 +0300
commit5a407a34442860ebaea2886f2278be9e1eb33a8d (patch)
treed2e7a6dfa768e84baf283fe93a27658bdc873f4d /wqflask
parent71a859c9facc7ae49d43e3e995166ad8dcb586cb (diff)
downloadgenenetwork2-5a407a34442860ebaea2886f2278be9e1eb33a8d.tar.gz
replace redis fetch for cached timestamp with a query
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/data_set.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index f0a930a5..52d1d254 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -1301,8 +1301,6 @@ def cache_dataset_results(dataset_name: str, dataset_type: str, query_results: L
table_timestamp = query_table_timestamp(dataset_type)
- results = r.set(f"{dataset_type}timestamp", table_timestamp)
-
file_name = generate_hash_file(dataset_name, dataset_type, table_timestamp)
file_path = os.path.join(TMPDIR, f"{file_name}.json")
@@ -1313,12 +1311,7 @@ def cache_dataset_results(dataset_name: str, dataset_type: str, query_results: L
def fetch_cached_results(dataset_name: str, dataset_type: str):
"""function to fetch the cached results"""
- table_timestamp = r.get(f"{dataset_type}timestamp")
-
- if table_timestamp is not None:
- table_timestamp = table_timestamp.decode("utf-8")
- else:
- table_timestamp = ""
+ table_timestamp = query_table_timestamp(dataset_type)
file_name = generate_hash_file(dataset_name, dataset_type, table_timestamp)
file_path = os.path.join(TMPDIR, f"{file_name}.json")