From 8b73372b6e63b0e6f58dffa7668a73990a599dc4 Mon Sep 17 00:00:00 2001 From: Hemna Date: Wed, 21 Jun 2023 18:48:08 -0400 Subject: [PATCH] Added rpc server for listen Added the ability to start the rpc server for fetching stats from the listen command. If the rpc server is enabled in config, the rpc server will now start. --- aprsd/cmds/listen.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aprsd/cmds/listen.py b/aprsd/cmds/listen.py index 0aa168e..6137548 100644 --- a/aprsd/cmds/listen.py +++ b/aprsd/cmds/listen.py @@ -17,6 +17,7 @@ from rich.console import Console import aprsd from aprsd import cli_helper, client, packets, plugin, stats, threads from aprsd.aprsd import cli +from aprsd.rpc import server as rpc_server from aprsd.threads import rx @@ -181,6 +182,10 @@ def listen( keepalive = threads.KeepAliveThread() keepalive.start() + if CONF.rpc_settings.enabled: + rpc = rpc_server.APRSDRPCThread() + rpc.start() + pm = None pm = plugin.PluginManager() if load_plugins: @@ -204,3 +209,6 @@ def listen( keepalive.join() LOG.debug("listen_thread Join") listen_thread.join() + + if CONF.rpc_settings.enabled: + rpc.join()