Fixed invalid automatic telemetry request scheduling timebase

This commit is contained in:
Mark Qvist 2024-09-25 12:29:53 +02:00
parent 1d5cd89a49
commit 0902f869e1

View File

@ -759,6 +759,7 @@ class SidebandCore():
self.update_ignore_invalid_stamps() self.update_ignore_invalid_stamps()
except Exception as e: except Exception as e:
RNS.log("Error while reloading configuration: "+str(e), RNS.LOG_ERROR) RNS.log("Error while reloading configuration: "+str(e), RNS.LOG_ERROR)
RNS.trace_exception(e)
def __save_config(self): def __save_config(self):
RNS.log("Saving Sideband configuration...", RNS.LOG_DEBUG) RNS.log("Saving Sideband configuration...", RNS.LOG_DEBUG)
@ -1203,7 +1204,8 @@ class SidebandCore():
self.message_router.handle_outbound(message) self.message_router.handle_outbound(message)
else: else:
if message.state == LXMF.LXMessage.DELIVERED: if message.state == LXMF.LXMessage.DELIVERED:
self.setpersistent(f"telemetry.{RNS.hexrep(message.destination_hash, delimit=False)}.last_request_success_timebase", message.request_timebase) delivery_timebase = int(time.time())
self.setpersistent(f"telemetry.{RNS.hexrep(message.destination_hash, delimit=False)}.last_request_success_timebase", delivery_timebase)
self.setstate(f"telemetry.{RNS.hexrep(message.destination_hash, delimit=False)}.request_sending", False) self.setstate(f"telemetry.{RNS.hexrep(message.destination_hash, delimit=False)}.request_sending", False)
if message.destination_hash == self.config["telemetry_collector"]: if message.destination_hash == self.config["telemetry_collector"]:
self.pending_telemetry_request = False self.pending_telemetry_request = False