There was an error while loading. Please reload this page.
1 parent 271b1cc commit 6b93168Copy full SHA for 6b93168
1 file changed
piker/data/marketstore.py
@@ -469,13 +469,21 @@ async def read_ohlcv(
469
time_step = time[-1] - time[-2]
470
ts = tf_in_1s.inverse[data_set.timeframe]
471
472
- assert time_step == ts
473
-
474
- # if time_step != ts:
475
- # log.warning(f'MKTS BUG: wrong timeframe loaded: {time_step}')
476
- # if timeframe == 1:
477
- # await tractor.breakpoint()
478
- # return {}
+ if time_step != ts:
+ log.warning(
+ f'MKTS BUG: wrong timeframe loaded: {time_step}'
+ 'YOUR DATABASE LIKELY CONTAINS BAD DATA FROM AN OLD BUG'
+ f'WIPING HISTORY FOR {ts}s'
+ )
+ await self.delete_ts(fqsn, timeframe)
479
+
480
+ # try reading again..
481
+ return await self.read_ohlcv(
482
+ fqsn,
483
+ timeframe,
484
+ end,
485
+ limit,
486
487
488
return array
489
0 commit comments