From 65afea1ba534b51f947cbe7989d7f4d650bbc9e6 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 04 十一月 2024 18:29:00 +0800 Subject: [PATCH] 代码异常保护 --- third_data/code_plate_key_manager.py | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/third_data/code_plate_key_manager.py b/third_data/code_plate_key_manager.py index 196de26..09a40b6 100644 --- a/third_data/code_plate_key_manager.py +++ b/third_data/code_plate_key_manager.py @@ -293,12 +293,6 @@ def get_today_limit_up_reason(cls, code): return cls.__today_total_limit_up_reason_dict.get(code) - # 浠婃棩娑ㄥ仠鍘熷洜鍙樺寲 - def set_today_limit_up_reason_change(self, code, from_reason, to_reason): - RedisUtils.sadd(self.__get_redis(), f"kpl_limit_up_reason_his-{code}", from_reason) - RedisUtils.expire(self.__get_redis(), f"kpl_limit_up_reason_his-{code}", tool.get_expire()) - self.__set_total_keys(code) - # 璁剧疆浠g爜鐨勪粖鏃ユ定鍋滃師鍥� def __set_total_keys(self, code): keys = set() @@ -335,6 +329,8 @@ if codes: fresult[k] = codes return fresult + + # 瀹炴椂寮�鐩樺暒甯傚満鏁版嵁 @@ -1110,7 +1106,7 @@ class RadicalBuyBlockManager: """ - 婵�杩涗拱鏉垮潡绠$悊 + 鎵叆涔版澘鍧楃鐞� """ __TargetCodePlateKeyManager = TargetCodePlateKeyManager() # 涓婃鐨勬定鍋滀唬鐮� @@ -1371,8 +1367,8 @@ if RedicalBuyDataManager.can_buy(history_before_codes_info[0][0], DealAndDelegateWithBuyModeDataManager().get_deal_codes())[0]: return False, f"寮�1鏁伴噺锛歿count}锛屽墠鎺掍唬鐮佸彲涔帮細{history_before_codes_info[0]}" - return True, f"寮�1鏁伴噺锛歿count}锛屽墠鎺掍唬鐮佷笉鍙拱锛歿history_before_codes_info[0]}" - return True, f"寮�1鏁伴噺锛歿count}锛屽巻鍙�-{history_index + 1} 瀹炴椂-{current_index + 1}" + return True, f"寮�1鏁伴噺锛歿count}锛屽墠鎺掍唬鐮佷笉鍙拱锛歿history_before_codes_info[0]}锛屽巻鍙插墠鎺�-{history_before_codes_info}锛屽紑1浠g爜-{open_limit_up_block_codes}" + return True, f"寮�1鏁伴噺锛歿count}锛屽巻鍙�-{history_index + 1} 瀹炴椂-{current_index + 1}锛� 鍓嶆帓浠g爜-{current_before_codes_info}, 寮�1浠g爜-{open_limit_up_block_codes}" @classmethod def __is_radical_buy_with_block_up(cls, code, block, yesterday_limit_up_codes): @@ -1453,12 +1449,12 @@ else: # 璺濈涓婁釜浠g爜娑ㄥ仠5鍒嗛挓浠ュ唴 if tool.trade_time_sub(tool.timestamp_format(limit_up_timestamp, '%H:%M:%S'), - tool.timestamp_format(current_before_codes_info[-1][1], '%H:%M:%S')) >= 5 * 60: - return False, f"璺濈涓婁釜浠g爜娑ㄥ仠宸茶繃鍘�5鍒嗛挓锛坽current_before_codes_info[-1]}锛�" + tool.timestamp_format(current_before_codes_info[-1][1], '%H:%M:%S')) >= 10 * 60: + return False, f"璺濈涓婁釜浠g爜娑ㄥ仠宸茶繃鍘�10鍒嗛挓锛坽current_before_codes_info[-1]}锛�" else: if tool.trade_time_sub(tool.timestamp_format(limit_up_timestamp, '%H:%M:%S'), - tool.timestamp_format(current_before_codes_info[-1][1], '%H:%M:%S')) >= 5 * 60: - return False, f"璺濈涓婁釜浠g爜娑ㄥ仠宸茶繃鍘�5鍒嗛挓锛坽current_before_codes_info[-1]}锛�" + tool.timestamp_format(current_before_codes_info[-1][1], '%H:%M:%S')) >= 10 * 60: + return False, f"璺濈涓婁釜浠g爜娑ㄥ仠宸茶繃鍘�10鍒嗛挓锛坽current_before_codes_info[-1]}锛�" return True, f"婊¤冻涔板叆闇�姹�: 鍓嶆帓浠g爜-{current_before_codes_info}" -- Gitblit v1.8.0