Add clear-and-refetch for hub K-line cache.

Force refresh wipes the series in hub_kline.db before pulling from the exchange; add a Linux clear script and rename the UI button to 清库重拉.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-08 11:31:16 +08:00
parent 2095839fc3
commit ca6ef59a14
6 changed files with 197 additions and 2 deletions
+2
View File
@@ -675,6 +675,7 @@ def api_chart_ohlcv(
bms = int(bms_raw)
except ValueError:
raise HTTPException(status_code=400, detail="before_ms 无效")
clear_db = force and not tail_refresh and bms is None
def remote_fetch(**kwargs):
tf_use = kwargs.get("timeframe") or timeframe
@@ -693,6 +694,7 @@ def api_chart_ohlcv(
remote_fetch,
force_refresh=force,
tail_refresh=tail_refresh,
clear_db=clear_db,
limit=lim,
before_ms=bms,
)