Ensure Keepalive doesn't reset client at startup

This patch ensures that the keepalive thread doesn't try and
reset/restart the aprs connection at startup.
This commit is contained in:
Hemna 2023-09-14 16:46:00 -04:00
parent 140fa4ace4
commit ef206b1283
1 changed files with 6 additions and 1 deletions

View File

@ -82,7 +82,12 @@ class KeepAliveThread(APRSDThread):
# check the APRS connection
cl = client.factory.create()
if not cl.is_alive():
# Reset the connection if it's dead and this isn't our
# First time through the loop.
# The first time through the loop can happen at startup where
# The keepalive thread starts before the client has a chance
# to make it's connection the first time.
if not cl.is_alive() and self.cntr > 0:
LOG.error(f"{cl.__class__.__name__} is not alive!!! Resetting")
client.factory.create().reset()
else: