mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 19:04:15 +08:00
fix: 盘前维表同步后刷新 enriched 缓存, 修复跨天连板梯队不准
根因: 服务跨天不重启时, enriched 内存缓存残留前一交易日数据, 连板梯队/ 选股读到旧的涨跌停信号。盘前维表 (instruments) 含当日精确涨跌停价, 但同步 完成后未触发缓存重建。 修复: run_instruments_sync 完成后 (rows > 0), 执行 clear_cache + refresh_cache, 让 enriched 缓存基于最新维表 (含当日 limit_up/down) 重建。与设置页「清理并刷新」 按钮同等效果, 但盘前自动执行, 无需手动操作。
This commit is contained in:
@@ -69,10 +69,18 @@ def _resolve_universe(capset: CapabilitySet) -> list[str]:
|
||||
|
||||
|
||||
def run_instruments_sync(repo: KlineRepository) -> dict:
|
||||
"""盘前同步个股维表。"""
|
||||
"""盘前同步个股维表。
|
||||
|
||||
维表含当日涨跌停价 (limit_up/down), 同步完成后刷新 enriched 内存缓存,
|
||||
确保跨天后连板梯队/选股等读到的是基于最新维表的数据 (而非前一交易日残留)。
|
||||
"""
|
||||
rows = instrument_sync.sync_instruments(repo.store.data_dir)
|
||||
_refresh_instruments_view(repo)
|
||||
_invalidate("instruments")
|
||||
# 维表更新后重建 enriched 缓存 (clear + refresh, 与设置页「清理并刷新」同等效果)
|
||||
if rows > 0:
|
||||
repo.clear_cache()
|
||||
repo.refresh_cache()
|
||||
return {"instruments_rows": rows}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user