mirror of
https://git.quad4.io/RNS-Things/MeshChatX.git
synced 2026-08-28 09:14:10 +00:00
feat(auto_propagation): integrate AsyncUtils for asynchronous websocket client updates during node selection
This commit is contained in:
@@ -4,6 +4,7 @@ import time
|
||||
import RNS
|
||||
from LXMF.LXMRouter import LXMRouter
|
||||
|
||||
from meshchatx.src.backend.async_utils import AsyncUtils
|
||||
from meshchatx.src.backend.meshchat_utils import parse_lxmf_propagation_node_app_data
|
||||
|
||||
_PROP_FAILURE_STATES = frozenset(
|
||||
@@ -131,7 +132,9 @@ class AutoPropagationManager:
|
||||
if not sorted_candidates:
|
||||
return
|
||||
|
||||
previous_hex = self.config.lxmf_preferred_propagation_node_destination_hash.get()
|
||||
previous_hex = (
|
||||
self.config.lxmf_preferred_propagation_node_destination_hash.get()
|
||||
)
|
||||
ordered: list[tuple[int, str]] = []
|
||||
seen_hex: set[str] = set()
|
||||
if previous_hex and previous_hex in best_by_hex:
|
||||
@@ -163,6 +166,9 @@ class AutoPropagationManager:
|
||||
self.config.lxmf_preferred_propagation_node_destination_hash.set(
|
||||
node_hex,
|
||||
)
|
||||
AsyncUtils.run_async(
|
||||
self.app.send_config_to_websocket_clients(context=ctx),
|
||||
)
|
||||
return
|
||||
|
||||
if previous_hex:
|
||||
|
||||
Reference in New Issue
Block a user