removing a streams must never be pre-dated

This commit is contained in:
2025-05-20 17:29:00 +02:00
parent 6ffcf92aaf
commit 7b9a03eaa6

View File

@@ -381,12 +381,13 @@ class SEHistory(InfluxDBWrapper):
:param ts: the time or None when now :param ts: the time or None when now
""" """
flag = value is not None flag = value is not None
try: if flag:
previns, prevts = self.get_instrument(stream, ts, **tags) try:
if prevts is not None and (previns is None or (ts or 1e10) < prevts): previns, prevts = self.get_instrument(stream, ts, **tags)
ts = prevts + 0.001 if prevts is not None and (previns is None or (ts or 1e10) < prevts):
except Exception as e: ts = prevts + 0.001
print(f'Exception in get_instrument {e!r}') except Exception as e:
print(f'Exception in get_instrument {e!r}')
tags['stream'] = stream tags['stream'] = stream
if flag: if flag:
tags['instrument'] = value tags['instrument'] = value