mirror of
https://github.com/markqvist/Sideband.git
synced 2026-04-27 14:20:38 +00:00
Improved announce logging handling
This commit is contained in:
parent
fcc0341fe9
commit
39f00554a8
2 changed files with 9 additions and 9 deletions
|
|
@ -1064,7 +1064,7 @@ class SidebandApp(MDApp):
|
|||
self.sideband.setstate("app.running", True)
|
||||
self.sideband.setstate("app.foreground", False)
|
||||
self.app_state = SidebandApp.PAUSED
|
||||
self.sideband.should_persist_data(background=True)
|
||||
self.sideband.should_persist_data(background=False)
|
||||
RNS.log("App paused", RNS.LOG_DEBUG)
|
||||
return True
|
||||
|
||||
|
|
|
|||
|
|
@ -90,10 +90,10 @@ class PropagationNodeDetector():
|
|||
pass
|
||||
|
||||
else:
|
||||
RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)} with data: {app_data}", RNS.LOG_EXTREME)
|
||||
RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)}", RNS.LOG_EXTREME)
|
||||
|
||||
else:
|
||||
RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)} with data: {app_data}", RNS.LOG_EXTREME)
|
||||
RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)}", RNS.LOG_EXTREME)
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Error while processing received propagation node announce: "+str(e))
|
||||
|
|
@ -371,8 +371,9 @@ class SidebandCore():
|
|||
self.active_propagation_node = None
|
||||
self.propagation_detector = PropagationNodeDetector(self)
|
||||
|
||||
RNS.Transport.register_announce_handler(self)
|
||||
RNS.Transport.register_announce_handler(self.propagation_detector)
|
||||
if self.is_service or self.is_standalone:
|
||||
RNS.Transport.register_announce_handler(self)
|
||||
RNS.Transport.register_announce_handler(self.propagation_detector)
|
||||
|
||||
self.active_command_plugins = {}
|
||||
self.active_service_plugins = {}
|
||||
|
|
@ -806,8 +807,7 @@ class SidebandCore():
|
|||
def __save_config(self, no_thread=False):
|
||||
RNS.log("Saving Sideband configuration...", RNS.LOG_DEBUG)
|
||||
def save_function():
|
||||
while self.saving_configuration:
|
||||
time.sleep(0.15)
|
||||
while self.saving_configuration: time.sleep(0.15)
|
||||
try:
|
||||
self.saving_configuration = True
|
||||
with open(self.config_path, "wb") as config_file: config_file.write(msgpack.packb(self.config))
|
||||
|
|
@ -826,8 +826,8 @@ class SidebandCore():
|
|||
if no_thread: save_function()
|
||||
else: threading.Thread(target=save_function, daemon=True).start()
|
||||
|
||||
if self.is_client:
|
||||
self.setstate("wants.settings_reload", True)
|
||||
if self.is_client: self.setstate("wants.settings_reload", True)
|
||||
RNS.log("Sideband configuration saved", RNS.LOG_DEBUG)
|
||||
|
||||
def __load_plugins(self):
|
||||
plugins_path = self.config["command_plugins_path"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue