From 287c506725b2d970f721f80169f83c2418cb0991 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 04 六月 2025 18:39:02 +0800
Subject: [PATCH] 添加新版低吸中间服务器

---
 data_server.py |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/data_server.py b/data_server.py
index 39ea3d4..e16b735 100644
--- a/data_server.py
+++ b/data_server.py
@@ -7,8 +7,7 @@
 import dask
 
 from code_attribute import gpcode_manager
-from log import logger_request_debug
-from log_module import log_analyse, log_export
+from log_module import log_analyse, log_export, log, request_log_util
 from output import limit_up_data_filter, output_util
 from output.limit_up_data_filter import IgnoreCodeManager
 from third_data import kpl_util, kpl_data_manager, kpl_api
@@ -44,10 +43,10 @@
             KPLLimitUpDataRecordManager.load_total_datas()
             total_datas = KPLLimitUpDataRecordManager.total_datas
 
-        current_datas_results = hosting_api_util.common_request({"ctype":"get_kpl_limit_up_datas"})
+        current_datas_results = hosting_api_util.common_request({"ctype": "get_kpl_limit_up_datas"})
         if type(current_datas_results) == str:
             current_datas_results = json.loads(current_datas_results)
-        current_datas = current_datas_results.get("data")  #KPLLimitUpDataRecordManager.latest_origin_datas
+        current_datas = current_datas_results.get("data")  # KPLLimitUpDataRecordManager.latest_origin_datas
         current_block_codes = {}
         for c in current_datas:
             if c[5] not in current_block_codes:
@@ -272,8 +271,7 @@
     def do_GET(self):
         path = self.path
         url = urlparse.urlparse(path)
-        thread_id = random.randint(0, 1000000)
-        logger_request_debug.info(f"GET 璇锋眰寮�濮�({thread_id})锛歿url.path}")
+        request_log_util.request_info("DATA_SERVER_GET", f"GET 璇锋眰寮�濮嬶細{url.path}")
         try:
             if url.path == "/kpl/get_limit_up_list":
                 response_data = self.__get_limit_up_list()
@@ -287,14 +285,12 @@
                 result = hosting_api_util.get_from_data_server(url.path, ps_dict)
                 self.__send_response(result)
         finally:
-            logger_request_debug.info(f"GET 璇锋眰缁撴潫({thread_id})锛歿url.path}")
-
+            request_log_util.request_info("DATA_SERVER_GET", f"GET 璇锋眰缁撴潫")
 
     def do_POST(self):
-        thread_id = random.randint(0, 1000000)
         path = self.path
         url = urlparse.urlparse(path)
-        logger_request_debug.info(f"POST 璇锋眰寮�濮�({thread_id})锛歿url.path}")
+        request_log_util.request_info("DATA_SERVER_POST", f"POST 璇锋眰寮�濮嬶細{url.path}")
         try:
             if url.path == "/upload_kpl_data":
                 # 鎺ュ彈寮�鐩樺暒鏁版嵁
@@ -302,7 +298,7 @@
                 result_str = self.__process_kpl_data(params)
                 self.__send_response(result_str)
         finally:
-            logger_request_debug.info(f"POST 璇锋眰缁撴潫({thread_id})锛歿url.path}")
+            request_log_util.request_info("DATA_SERVER_POST", f"POST 璇锋眰缁撴潫")
 
     def __process_kpl_data(self, data):
         data = json.loads(json.dumps(data).replace("姒傚康", ""))

--
Gitblit v1.8.0