From 5ed30c03ddfedd4cf79cd8fea9fc45b05821d898 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期一, 16 十月 2023 12:44:07 +0800
Subject: [PATCH] 真实下单位置计算方法修改

---
 outside_api_command_manager.py |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/outside_api_command_manager.py b/outside_api_command_manager.py
index 29755c1..53c2b08 100644
--- a/outside_api_command_manager.py
+++ b/outside_api_command_manager.py
@@ -11,8 +11,8 @@
 # 蹇冭烦淇℃伅
 from huaxin_client import socket_util
 from huaxin_client.client_network import SendResponseSkManager
-from log_module.log import logger_debug
-from utils import middle_api_protocol
+from log_module.log import logger_debug, logger_system
+from utils import middle_api_protocol, tool
 
 MSG_TYPE_HEART = "heart"
 # 鍛戒护淇℃伅
@@ -52,7 +52,8 @@
 API_TYPE_CODE_TRADE_STATE = "code_trade_state"  # 浠g爜浜ゆ槗鐘舵��
 API_TYPE_GET_ENV = "get_env"  # 鑾峰彇鐜淇℃伅
 API_TYPE_SYNC_L1_TARGET_CODES = "sync_l1_subscript_codes"  # 鍚屾L1闇�瑕佽闃呯殑浠g爜
-
+API_TYPE_SYSTEM_LOG = "system_log"  # 绯荤粺鏃ュ織
+API_TYPE_GET_FROM_DATA_SERVER = "get_from_data_server"  # 浠庢暟鎹湇鍔″櫒鎷夊彇鏁版嵁
 
 class ActionCallback(object):
     # 浜ゆ槗
@@ -90,6 +91,9 @@
         pass
 
     def OnSyncL2SubscriptCodes(self, client_id, request_id):
+        pass
+
+    def OnGetFromDataServer(self, client_id, request_id, data):
         pass
 
 
@@ -185,8 +189,12 @@
                             cls.action_callback.OnGetCodeTradeState(client_id, request_id, data)
                         elif content_type == API_TYPE_GET_ENV:
                             cls.action_callback.OnGetEnvInfo(client_id, request_id, data)
-                        elif content_type == API_TYPE_GET_ENV:
+                        elif content_type == API_TYPE_SYNC_L1_TARGET_CODES:
                             cls.action_callback.OnSyncL2SubscriptCodes(client_id, request_id)
+                        elif content_type == API_TYPE_SYSTEM_LOG:
+                            cls.action_callback.OnSystemLog(client_id, request_id, data)
+                        elif content_type == API_TYPE_GET_FROM_DATA_SERVER:
+                            cls.action_callback.OnGetFromDataServer(client_id, request_id, data)
                     except Exception as e:
                         logging.exception(e)
                         pass
@@ -216,9 +224,6 @@
                 sk.send(socket_util.load_header(json.dumps({"type": "heart", "client_id": client_id}).encode('utf-8')))
                 # print("蹇冭烦淇℃伅鍙戦�佹垚鍔�", client_id)
             except Exception as e:
-                logging.error("閿欒")
-                print("蹇冭烦淇℃伅鍙戦�佸け璐�", _type, client_id)
-                logging.exception(e)
                 if _type == CLIENT_TYPE_TRADE:
                     if client_id in cls.trade_client_dict:
                         cls.trade_client_dict.pop(client_id)
@@ -244,6 +249,7 @@
 
     @classmethod
     def __maintain_client(cls):
+        logger_system.info(f"outside_api __maintain_client 绾跨▼ID:{tool.get_thread_id()}")
         while True:
             try:
                 if len(cls.trade_client_dict) < cls.trade_client_count:

--
Gitblit v1.8.0