1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-18 06:11:49 -05:00

Start keepalive thread first

This patch changes the order of the threads starting.  The Keepalive
thread's job is to test the aprsis/kiss client to see if it's up and
running, and then issue a reset if it's down.   On SIGINT, the keepalive
might issue that reset in the middle of a shutdown, which might cause
things to hang when everything should be shutting down.  Making the
KeepaliveThread first, means it will be the first to be shut down as
well, preventing the next loop from resetting the client.
This commit is contained in:
Hemna 2023-08-23 13:45:46 -04:00
parent 34311f0fbd
commit 859f904602
2 changed files with 7 additions and 6 deletions

View File

@ -94,6 +94,9 @@ def server(ctx, flush):
packets.WatchList().load() packets.WatchList().load()
packets.SeenList().load() packets.SeenList().load()
keepalive = threads.KeepAliveThread()
keepalive.start()
rx_thread = rx.APRSDPluginRXThread( rx_thread = rx.APRSDPluginRXThread(
packet_queue=threads.packet_queue, packet_queue=threads.packet_queue,
) )
@ -105,9 +108,6 @@ def server(ctx, flush):
packets.PacketTrack().restart() packets.PacketTrack().restart()
keepalive = threads.KeepAliveThread()
keepalive.start()
if CONF.rpc_settings.enabled: if CONF.rpc_settings.enabled:
rpc = rpc_server.APRSDRPCThread() rpc = rpc_server.APRSDRPCThread()
rpc.start() rpc.start()

View File

@ -479,6 +479,10 @@ def webchat(ctx, flush, port):
packets.WatchList() packets.WatchList()
packets.SeenList() packets.SeenList()
keepalive = threads.KeepAliveThread()
LOG.info("Start KeepAliveThread")
keepalive.start()
socketio = init_flask(loglevel, quiet) socketio = init_flask(loglevel, quiet)
rx_thread = rx.APRSDPluginRXThread( rx_thread = rx.APRSDPluginRXThread(
packet_queue=threads.packet_queue, packet_queue=threads.packet_queue,
@ -490,9 +494,6 @@ def webchat(ctx, flush, port):
) )
process_thread.start() process_thread.start()
keepalive = threads.KeepAliveThread()
LOG.info("Start KeepAliveThread")
keepalive.start()
LOG.info("Start socketio.run()") LOG.info("Start socketio.run()")
socketio.run( socketio.run(
flask_app, flask_app,