admin
2025-04-29 391885a3d44428aa326fcabd39bf8f4f78f66e0d
记录耗时日志
1个文件已修改
4 ■■■ 已修改文件
data_server.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
data_server.py
@@ -123,6 +123,7 @@
            response_data = json.dumps({"code": 0, "data": {}})
        elif url.path == "/get_env":
            request_id = params_dict.get("request_id")
            use_time_list = []
            try:
                __start_time = time.time()
@@ -186,10 +187,11 @@
                response_data = json.dumps(result)
            except Exception as e:
                response_data = json.dumps({"code": 1, "msg": str(e)})
                logger_debug.error(f"环境获取异常:{request_id}")
                logger_debug.exception(e)
            finally:
                if use_time_list and use_time_list[-1][1] > 10:
                    logger_debug.warning(f"环境获取时间大于10s:{use_time_list}")
                    logger_debug.warning(f"环境获取时间大于10s({request_id}):{use_time_list}")
        elif url.path == "/load_kpl_stock_of_markets_plate":
            # 加载数据