From 0484e9738264b8960336fd3125e4455dc1568f3b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 14 Jun 2023 14:29:53 -0400 Subject: [PATCH] Try to not overrun shm during gap backfilling.. --- piker/data/history.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/piker/data/history.py b/piker/data/history.py index fce81063..b2cf6b68 100644 --- a/piker/data/history.py +++ b/piker/data/history.py @@ -396,9 +396,15 @@ async def start_backfill( end_dt=end_dt, ) + # XXX TODO: pretty sure if i plot tsla, btcusdt.binance + # and mnq.cme.ib this causes a Qt crash XXDDD + + # make sure we don't overrun the buffer start + len_to_push: int = min(iend, array.size) + to_push: np.ndarray = array[-len_to_push:] await shm_push_in_between( shm, - array, + to_push, prepend_index=iend, update_start_on_prepend=False, )