From 75ff8034a0ce80f8ae597499b96019a807c39a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B7=E5=B0=8F=E5=89=8D?= Date: Thu, 22 Jan 2026 17:36:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0ios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 63ffbe85..44ecec06 100755 --- a/app.py +++ b/app.py @@ -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 = """