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:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user