From 22d6865feb5d475a1f17b47eba96d2a7dfbb66a0 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 16 八月 2023 09:59:11 +0800 Subject: [PATCH] ++++++++++++++++ bug修复- --- l2/l2_data_source_util.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/l2/l2_data_source_util.py b/l2/l2_data_source_util.py index 1846fe2..d6d0942 100644 --- a/l2/l2_data_source_util.py +++ b/l2/l2_data_source_util.py @@ -1,6 +1,8 @@ """ L2鏁版嵁婧簮 """ +import constant +from log_module.log import logger_l2_error from utils import tool @@ -64,7 +66,7 @@ for bd in buy_datas: # 鏍规嵁璁㈠崟鍙峰仛鍖归厤 if bd["val"]["orderNo"] == cancel_data["val"]["orderNo"]: - return bd + return bd["index"] return None # 鍚岃姳椤烘笭閬撶殑L2锛屾牴鎹拱鎾ゆ暟鎹煡鎵句拱鍏ユ暟鎹� @@ -113,7 +115,10 @@ buy_index = cls.__get_buy_index_cache(code, cancel_data["index"]) if buy_index is not None: return buy_index - return cls.__get_buy_index_with_cancel_data_by_ths_l2(code, cancel_data, local_today_num_operate_map) + if constant.L2_SOURCE_TYPE == constant.L2_SOURCE_TYPE_HUAXIN: + return cls.__get_buy_index_with_cancel_data_by_huaxin_l2(code, cancel_data, local_today_num_operate_map) + else: + return cls.__get_buy_index_with_cancel_data_by_ths_l2(code, cancel_data, local_today_num_operate_map) # 鏍规嵁涔版挙鏁版嵁(涓庝粖鏃ユ�荤殑鏁版嵁)璁$畻涔板叆鏁版嵁 @classmethod @@ -136,8 +141,8 @@ data = None try: data = total_data[index] - except: - print("") + except Exception as e: + logger_l2_error.error(f"鏈壘鍒颁拱鍏ョ储寮曞搴旂殑鏁版嵁锛歩ndex-{index} total_data闀垮害-{len(total_data) if total_data else 0} 閿欒鍘熷洜锛歿str(e)}") val = data["val"] # 鍒ゆ柇褰撳墠涔版槸鍚﹀凡缁忎拱鎾� cancel_datas = local_today_num_operate_map.get( @@ -145,7 +150,6 @@ canceled = False if cancel_datas: for cancel_data in cancel_datas: - buy_index = cls.get_buy_index_with_cancel_data(code, cancel_data, local_today_num_operate_map) if buy_index == index: canceled = True -- Gitblit v1.8.0