From 73e4f3990342d1fd01da1ff39e9f4fb0d62745e7 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 05 十二月 2024 22:34:05 +0800 Subject: [PATCH] bug修复 --- third_data/code_plate_key_manager.py | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-) diff --git a/third_data/code_plate_key_manager.py b/third_data/code_plate_key_manager.py index 688648e..07ea293 100644 --- a/third_data/code_plate_key_manager.py +++ b/third_data/code_plate_key_manager.py @@ -352,6 +352,24 @@ __top_jx_out_blocks = [] # 绮鹃�夋澘鍧楁祦鍏ラ噾棰� __jx_blocks_in_money_dict = {} + # 甯傚満琛屾儏鐑害锛岄粯璁や负60 + __market_strong = 60 + + @classmethod + def get_jingxuan_in_block_threshold_count(cls): + """ + 鑾峰彇涔扮簿閫夋祦鍏ュ墠鍑� + @return: + """ + score = 60 + if cls.__market_strong is not None: + score = int(cls.__market_strong) + score = score // 10 + if score >= 10: + score = 9 + if score < 6: + score = 5 + return score * 2 - 2 @classmethod def set_market_jingxuan_blocks(cls, datas): @@ -365,6 +383,8 @@ THRESHOLD_MONEY = min(THRESHOLD_MONEY, 10000) THRESHOLD_MONEY = max(THRESHOLD_MONEY, 1000) THRESHOLD_MONEY = THRESHOLD_MONEY * 10000 + # 鏈�澶ф暟閲� + MAX_COUNT = cls.get_jingxuan_in_block_threshold_count() cls.top_in_list_cache = datas blocks = set() @@ -394,7 +414,7 @@ if has_code: count += 1 - if count >= 10: + if count >= MAX_COUNT: break # 璁板綍绮鹃�夋祦鍑烘棩蹇� async_log_util.info(logger_kpl_jx_in, f"鍘熸暟鎹細{datas[:20]} 鏉垮潡锛歿blocks}") @@ -430,6 +450,19 @@ # 璁板綍绮鹃�夋祦鍑烘棩蹇� async_log_util.info(logger_kpl_jx_out, f"鍘熸暟鎹細{datas[:10]} 鏉垮潡锛歿blocks}") cls.__top_jx_out_blocks = list(blocks) + + @classmethod + def set_market_strong(cls, strong): + """ + 璁剧疆甯傚満琛屾儏寮哄害 + @param strong: + @return: + """ + cls.__market_strong = strong + + @classmethod + def get_market_strong(cls): + return cls.__market_strong @classmethod def get_top_market_jingxuan_blocks(cls): @@ -1146,4 +1179,5 @@ if __name__ == "__main__": - pass + RealTimeKplMarketData.set_market_strong(120) + print(RealTimeKplMarketData.get_jingxuan_in_block_threshold_count()) -- Gitblit v1.8.0