From 815fe02c83509ce5a1ac9ee021081a05358fcc90 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Thu, 30 May 2019 04:27:20 +0200 Subject: [PATCH] Make sidebarGetPeers an async command --- plugins/Sidebar/SidebarPlugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/Sidebar/SidebarPlugin.py b/plugins/Sidebar/SidebarPlugin.py index 1b671271..4617a1ae 100644 --- a/plugins/Sidebar/SidebarPlugin.py +++ b/plugins/Sidebar/SidebarPlugin.py @@ -86,6 +86,10 @@ class UiRequestPlugin(object): @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): + def __init__(self, *args, **kwargs): + self.async_commands.add("sidebarGetPeers") + return super(UiWebsocketPlugin, self).__init__(*args, **kwargs) + def sidebarRenderPeerStats(self, body, site): connected = len([peer for peer in list(site.peers.values()) if peer.connection and peer.connection.connected]) connectable = len([peer_id for peer_id in list(site.peers.keys()) if not peer_id.endswith(":0")])