Iterate 1s and 1m from tsdb series

incremental_update_paths
Tyler Goodlet 2022-05-31 18:07:51 -04:00
parent a7ff47158b
commit fc24f5efd1
1 changed files with 7 additions and 6 deletions

View File

@ -639,12 +639,13 @@ async def tsdb_history_update(
tsdb_arrays = await storage.read_ohlcv(fqsn) tsdb_arrays = await storage.read_ohlcv(fqsn)
# hist diffing # hist diffing
if tsdb_arrays: if tsdb_arrays:
onesec = tsdb_arrays[1] for secs in (1, 60):
ts = tsdb_arrays.get(secs)
if ts is not None and len(ts):
# these aren't currently used but can be referenced from # these aren't currently used but can be referenced from
# within the embedded ipython shell below. # within the embedded ipython shell below.
to_append = ohlcv[ohlcv['time'] > onesec['Epoch'][-1]] to_append = ohlcv[ohlcv['time'] > ts['Epoch'][-1]]
to_prepend = ohlcv[ohlcv['time'] < onesec['Epoch'][0]] to_prepend = ohlcv[ohlcv['time'] < ts['Epoch'][0]]
profiler('Finished db arrays diffs') profiler('Finished db arrays diffs')