From 32a96952b6fc3429ca03668298e8efbd6a23daa0 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 10 十月 2024 13:36:31 +0800 Subject: [PATCH] bug修复 --- utils/init_data_util.py | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/utils/init_data_util.py b/utils/init_data_util.py index 3d6b0fe..7868b39 100644 --- a/utils/init_data_util.py +++ b/utils/init_data_util.py @@ -2,6 +2,7 @@ import decimal from code_attribute import gpcode_manager +from log_module.log import logger_debug from third_data.history_k_data_util import HistoryKDatasUtils from utils import tool @@ -13,12 +14,16 @@ def re_set_price_pres(codes, force=False): # 閫氳繃鍘嗗彶鏁版嵁缂撳瓨鑾峰彇 - result = HistoryKDatasUtils.get_gp_latest_info(codes) - for item in result: - symbol = item['symbol'] - symbol = symbol.split(".")[1] - pre_close = tool.to_price(decimal.Decimal(str(item['pre_close']))) - gpcode_manager.CodePrePriceManager.set_price_pre(symbol, pre_close, force) + try: + result = HistoryKDatasUtils.get_gp_latest_info(codes) + for item in result: + symbol = item['symbol'] + symbol = symbol.split(".")[1] + pre_close = tool.to_price(decimal.Decimal(str(item['pre_close']))) + gpcode_manager.CodePrePriceManager.set_price_pre(symbol, pre_close, force) + except Exception as e: + logger_debug.error(f"get_gp_latest_info寮傚父:{codes}") + logger_debug.exception(e) # 鑾峰彇杩�90澶╃殑鏈�澶ч噺涓庢渶杩戠殑閲� -- Gitblit v1.8.0