fix: refresh same-day OHLCV bars

This commit is contained in:
2026-08-03 23:13:17 +02:00
parent 7bcdf77ef9
commit 7d703ea524
4 changed files with 102 additions and 9 deletions
+6 -1
View File
@@ -129,7 +129,12 @@ async def fetch_and_ingest(
if bar_count < minimum_backfill_bars:
start_date = backfill_start
elif progress is not None:
start_date = progress.last_ingested_date + timedelta(days=1)
# Re-fetch the latest stored session so an in-progress daily bar can
# be overwritten as the market moves. Starting one day later makes
# every subsequent intraday, near-close, and manual refresh skip
# today's bar once the first partial snapshot has been stored.
# The price-store upsert keeps this one-session overlap idempotent.
start_date = progress.last_ingested_date
else:
start_date = backfill_start