From 998dbbd175a47ee1821a04778317b9e053989c52 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 16 八月 2023 09:50:02 +0800 Subject: [PATCH] ++++++++++++++++ bug修复- --- huaxin_api/command_manager.py | 48 ++++++++++++++++++++++++++---------------------- 1 files changed, 26 insertions(+), 22 deletions(-) diff --git a/huaxin_api/command_manager.py b/huaxin_api/command_manager.py index f56bd59..0305276 100644 --- a/huaxin_api/command_manager.py +++ b/huaxin_api/command_manager.py @@ -72,29 +72,33 @@ @classmethod def __process_command(cls, _type, client_id, result_json): - data = result_json["data"] - print("鎺ユ敹鍐呭", result_json) - request_id = result_json.get('request_id') - if not socket_util.is_client_params_sign_right(result_json): - print("绛惧悕閿欒") - # 绛惧悕鍑洪敊 - SendResponseSkManager.send_error_response(_type, request_id, client_id, - {"code": -1, "msg": "绛惧悕閿欒"}) - return + try: + data = result_json["data"] + print("鎺ユ敹鍐呭", result_json) + request_id = result_json.get('request_id') + if not socket_util.is_client_params_sign_right(result_json): + print("绛惧悕閿欒") + # 绛惧悕鍑洪敊 + SendResponseSkManager.send_error_response(_type, request_id, client_id, + {"code": -1, "msg": "绛惧悕閿欒"}) + return - if _type == CLIENT_TYPE_TRADE: - # 浜ゆ槗 - ctype = data["trade_type"] - cls.action_callback.OnTrade(client_id, request_id, ctype, data) - elif _type == CLIENT_TYPE_MONEY: - cls.action_callback.OnMoney(client_id, request_id) - elif _type == CLIENT_TYPE_DEAL_LIST: - cls.action_callback.OnDealList(client_id, request_id) - elif _type == CLIENT_TYPE_DELEGATE_LIST: - can_cancel = data["can_cancel"] - cls.action_callback.OnDelegateList(client_id, request_id, can_cancel) - elif _type == CLIENT_TYPE_POSITION_LIST: - cls.action_callback.OnPositionList(client_id, request_id) + if _type == CLIENT_TYPE_TRADE: + # 浜ゆ槗 + ctype = data["trade_type"] + cls.action_callback.OnTrade(client_id, request_id, ctype, data) + elif _type == CLIENT_TYPE_MONEY: + cls.action_callback.OnMoney(client_id, request_id) + elif _type == CLIENT_TYPE_DEAL_LIST: + cls.action_callback.OnDealList(client_id, request_id) + elif _type == CLIENT_TYPE_DELEGATE_LIST: + can_cancel = data["can_cancel"] + cls.action_callback.OnDelegateList(client_id, request_id, can_cancel) + elif _type == CLIENT_TYPE_POSITION_LIST: + cls.action_callback.OnPositionList(client_id, request_id) + except Exception as e: + logging.exception(e) + logging.error(result_json) @classmethod def run_process_command(cls, pipe_strategy): -- Gitblit v1.8.0