From aab5de28409a15738b8520db11c8da91d8da8681 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Sat, 22 Mar 2025 12:12:57 +0800 Subject: [PATCH] Refine --- auto_cache.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/auto_cache.py b/auto_cache.py index babb51b..6fa0ee7 100644 --- a/auto_cache.py +++ b/auto_cache.py @@ -5,9 +5,11 @@ import shutil import redis import urllib.request -def query_all_records_by_date_with_type(date: str): +def queryallrecordsbydatewithtype(date: str): + print(f'queryallrecordsbydatewithtype: {date}') + try: - response = urllib.request.urlopen(f'http://localhost/queryallrecordsbydatewithtype/?querydate={date}&querytype=node') + response = urllib.request.urlopen(f'http://localhost/{method_name}/?querydate={date}&querytype=node') html = response.read().decode('utf-8') #print(html) @@ -18,6 +20,8 @@ def query_all_records_by_date_with_type(date: str): print("Error") def queryallrecordsbydateproperty(date: str): + print(f'queryallrecordsbydateproperty: {date}') + try: response = urllib.request.urlopen(f'http://localhost/queryallrecordsbydateproperty/?querydate={date}&querytype=node&property=head') html = response.read().decode('utf-8') @@ -31,6 +35,8 @@ def queryallrecordsbydateproperty(date: str): print("Error") def queryallscadarecordsbydate(date: str): + print(f'queryallscadarecordsbydate: {date}') + try: response = urllib.request.urlopen(f'http://localhost/queryallscadarecordsbydate/?querydate={date}') html = response.read().decode('utf-8') @@ -39,6 +45,8 @@ def queryallscadarecordsbydate(date: str): print("Error") def queryallschemeallrecords(date: str): + print(f'queryallschemeallrecords: {date}') + try: response = urllib.request.urlopen(f'http://localhost/queryallschemeallrecords/?schemetype=burst_Analysis&schemename=testSchema&querydate={date}') html = response.read().decode('utf-8') @@ -70,7 +78,7 @@ def auto_cache_data(): str_prev_day = prev_day.strftime('%Y-%m-%d') print(str_prev_day) - query_all_records_by_date_with_type(str_prev_day) + queryallrecordsbydatewithtype(str_prev_day) queryallrecordsbydateproperty(str_prev_day) queryallscadarecordsbydate(str_prev_day) queryallschemeallrecords(str_prev_day)