another session connect fix

This commit is contained in:
DJ2LS 2022-11-18 10:29:20 +01:00
parent b29df86339
commit ffe249da3f

View file

@ -337,6 +337,12 @@ def process_tnc_commands(data):
# set early disconnecting state so we can interrupt connection attempts
static.ARQ_SESSION_STATE = "disconnecting"
# wait for disconnecting
log.info(
"[SCK] Waiting for disconnecting",
callsign=static.DXCALLSIGN,
command=received_json,
)
# set disconnect timeout to 15 seconds to avoid being stuck here if disconnect fails
disconnect_timeout = time.time() + 15
# wait until disconnected or timeout reached
@ -373,16 +379,6 @@ def process_tnc_commands(data):
# allow beacon transmission again
static.BEACON_PAUSE = False
# finally an error - we shouldn't reach this point
command_response("connect", False)
log.error(
"[SCK] Connect command execution error - shouldn't reach this point",
e="connection exists",
command=received_json,
)
# allow beacon transmission again
static.BEACON_PAUSE = False
# DISCONNECT ----------------------------------------------------------
if received_json["type"] == "arq" and received_json["command"] == "disconnect":