更新ios
This commit is contained in:
3
app.py
3
app.py
@@ -7008,6 +7008,8 @@ def get_watchlist_realtime():
|
|||||||
load_trading_days()
|
load_trading_days()
|
||||||
|
|
||||||
# ========== 使用 Redis 缓存优化批量查询 ==========
|
# ========== 使用 Redis 缓存优化批量查询 ==========
|
||||||
|
today = datetime.now().date()
|
||||||
|
|
||||||
# 1. 先从缓存批量获取
|
# 1. 先从缓存批量获取
|
||||||
cached_prices, missing_codes = get_cached_latest_prices_batch(full_codes)
|
cached_prices, missing_codes = get_cached_latest_prices_batch(full_codes)
|
||||||
|
|
||||||
@@ -7028,7 +7030,6 @@ def get_watchlist_realtime():
|
|||||||
# 3. 查询缓存未命中的股票(使用 7 天回溯以处理节假日)
|
# 3. 查询缓存未命中的股票(使用 7 天回溯以处理节假日)
|
||||||
if missing_codes:
|
if missing_codes:
|
||||||
client = get_clickhouse_client()
|
client = get_clickhouse_client()
|
||||||
today = datetime.now().date()
|
|
||||||
start_date = today - timedelta(days=7)
|
start_date = today - timedelta(days=7)
|
||||||
|
|
||||||
batch_query = """
|
batch_query = """
|
||||||
|
|||||||
Reference in New Issue
Block a user