From cbe19ea6066a600cbd0b5110db5d43f8252d14a8 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 13 六月 2024 11:23:53 +0800
Subject: [PATCH] L撤成交进度相关改进

---
 outside_api_command_manager.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/outside_api_command_manager.py b/outside_api_command_manager.py
index 6387474..86d9be6 100644
--- a/outside_api_command_manager.py
+++ b/outside_api_command_manager.py
@@ -11,7 +11,7 @@
 # 蹇冭烦淇℃伅
 from huaxin_client import socket_util
 from huaxin_client.client_network import SendResponseSkManager
-from log_module.log import logger_system
+from log_module.log import logger_system, logger_request_api
 from utils import middle_api_protocol, tool
 
 MSG_TYPE_HEART = "heart"
@@ -41,6 +41,7 @@
 CODE_LIST_BLACK = "black"
 CODE_LIST_WANT = "want"
 CODE_LIST_PAUSE_BUY = "pause_buy"
+CODE_LIST_MUST_BUY = "must_buy"
 
 # 绫诲瀷
 API_TYPE_TRADE = "trade"  # 浜ゆ槗
@@ -187,6 +188,7 @@
             try:
                 result = socket_util.recv_data(sk)[0]
                 if result:
+                    start_time = time.time()
                     try:
                         print("鎺ユ敹鏁版嵁", _type, result)
                         result_json = json.loads(result)
@@ -205,7 +207,6 @@
                             SendResponseSkManager.send_error_response(_type, request_id, client_id,
                                                                       {"code": -1, "msg": "绛惧悕閿欒"})
                             continue
-
                         if content_type == API_TYPE_TRADE:
                             # 浜ゆ槗
                             cls.action_callback.OnTrade(client_id, request_id, data)
@@ -247,8 +248,11 @@
                             cls.action_callback.OnCommonRequest(client_id, request_id, data)
                     except Exception as e:
                         logging.exception(e)
-                        pass
                     finally:
+                        use_time = int(time.time() - start_time)
+                        if use_time > 5:
+                            result_json = json.loads(result)
+                            logger_request_api.info(f"瓒呮椂5s浠ヤ笂锛歿result_json['data']['type']}")
                         # 鍙戦�佸搷搴�
                         sk.send(json.dumps({"type": "cmd_recieve"}).encode('utf-8'))
                 else:

--
Gitblit v1.8.0