更新ios

This commit is contained in:
2026-01-22 17:36:38 +08:00
parent 89cf8c3e74
commit 75ff8034a0

3
app.py
View File

@@ -7008,6 +7008,8 @@ def get_watchlist_realtime():
load_trading_days()
# ========== 使用 Redis 缓存优化批量查询 ==========
today = datetime.now().date()
# 1. 先从缓存批量获取
cached_prices, missing_codes = get_cached_latest_prices_batch(full_codes)
@@ -7028,7 +7030,6 @@ def get_watchlist_realtime():
# 3. 查询缓存未命中的股票(使用 7 天回溯以处理节假日)
if missing_codes:
client = get_clickhouse_client()
today = datetime.now().date()
start_date = today - timedelta(days=7)
batch_query = """