modify scripts
This commit is contained in:
@ -241,13 +241,14 @@ def main(list, args_debug, notify):
|
||||
for market_id in market_list:
|
||||
# 获取交易日期
|
||||
trading_day_checker = TradingDayChecker()
|
||||
if not trading_day_checker.is_trading_day_today(market_id.upper()) and not debug:
|
||||
logging.info(f"非交易日,不处理 {market_id} 市场,当前交易日期: {trading_date}, 当前日期: {current_date}")
|
||||
continue
|
||||
|
||||
trading_date = trading_day_checker.get_trading_date(market_id.upper())
|
||||
if not trading_date:
|
||||
logging.error(f"无法获取 {market_id} 市场的交易日期")
|
||||
continue
|
||||
if trading_date != current_date and not debug:
|
||||
logging.info(f"非交易日,不处理 {market_id} 市场,当前交易日期: {trading_date}, 当前日期: {current_date}")
|
||||
continue
|
||||
|
||||
# 获取快照数据
|
||||
snap_data = fetch_snap_all(market_id, trading_date)
|
||||
@ -261,7 +262,7 @@ def main(list, args_debug, notify):
|
||||
logging.info(f"成功获取 {market_id} 市场的快照数据,记录数: {len(snap_data)}")
|
||||
|
||||
if notify:
|
||||
send_to_wecom(f"成功获取 {market_id} 市场的快照数据,记录数: {len(snap_data)}")
|
||||
send_to_wecom(f"fetched {market_id} snap data, counts: {len(snap_data)}")
|
||||
|
||||
em_code_map.update({row['代码']: row['代码前缀'] for _, row in snap_data.iterrows()})
|
||||
time.sleep(5)
|
||||
|
||||
Reference in New Issue
Block a user