aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2021-10-27 15:59:36 +0300
committerBonfaceKilz2021-11-04 15:22:13 +0300
commit7bb86ff7e0b89fd714077a6d6b01f9b17f2ce953 (patch)
tree778eab59cb85c5b59905ee60b60ce3dd246adea6
parent3c773fc2b1123c116f35ab80e91dee531b6d3d2d (diff)
downloadgenenetwork2-7bb86ff7e0b89fd714077a6d6b01f9b17f2ce953.tar.gz
check for null timestamp
-rw-r--r--wqflask/base/data_set.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index ef4b1e13..70c58136 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -1263,7 +1263,7 @@ def query_table_timestamp(dataset_type: str):
query_update_time = f"""
SELECT UPDATE_TIME FROM information_schema.tables
- WHERE TABLE_SCHEMA = 'db_webqtl'
+ WHERE TABLE_SCHEMA = 'db_webqtl_s'
AND TABLE_NAME = '{dataset_type}Data'
"""
@@ -1300,7 +1300,12 @@ 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").decode("utf-8")
+ table_timestamp = r.get(f"{dataset_type}timestamp")
+
+ if table_timestamp is not None:
+ table_timestamp = table_timestamp.decode("utf-8")
+ else:
+ table_timestamp = ""
file_name = generate_hash_file(dataset_name, table_timestamp)
file_path = os.path.join(TMPDIR, f"{file_name}.json")