Skip to content

Commit 6b93168

Browse files
committed
Just wipe wrong timeframe filled tsdb colseries for now
1 parent 271b1cc commit 6b93168

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

piker/data/marketstore.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -469,13 +469,21 @@ async def read_ohlcv(
469469
time_step = time[-1] - time[-2]
470470
ts = tf_in_1s.inverse[data_set.timeframe]
471471

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 {}
472+
if time_step != ts:
473+
log.warning(
474+
f'MKTS BUG: wrong timeframe loaded: {time_step}'
475+
'YOUR DATABASE LIKELY CONTAINS BAD DATA FROM AN OLD BUG'
476+
f'WIPING HISTORY FOR {ts}s'
477+
)
478+
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+
)
479487

480488
return array
481489

0 commit comments

Comments
 (0)