修复 Gate K 线分页:单次不足 300 根时继续拉取至最新

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-02 13:15:35 +08:00
parent 1f13638732
commit 73a51fd996
3 changed files with 67 additions and 7 deletions
+3 -3
View File
@@ -255,9 +255,9 @@ def resolve_chart_bars(
remote_err: Optional[str] = None
if need_fetch:
since = fetch_start_ms
if db_rows and not force_refresh:
since = min(since, int(db_rows[0]["open_time_ms"]))
since = None
if db_rows and not force_refresh and newest_ok and len(db_rows) >= need:
since = max(0, int(newest_db) - period_ms * 2)
remote = remote_fetch(
symbol=sym,
timeframe=tf,