From ad37cfbe2fe3a1f8124b73557c469daa80211e5a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 29 Aug 2023 08:43:14 -0400 Subject: [PATCH] Break backfill loop on `end_dt < start_dt` --- piker/data/history.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/piker/data/history.py b/piker/data/history.py index aad7d49f..9d110bb2 100644 --- a/piker/data/history.py +++ b/piker/data/history.py @@ -418,6 +418,12 @@ async def start_backfill( start_dt = from_timestamp(start) end_dt = from_timestamp(end) + + # if we get a baddly ordered timestamp + # pair, imeeditately stop backfilling. + if end_dt < start_dt: + break + ( array, next_start_dt,