From e450c2cdb0af140707f46528d40411125b387ec2 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Fri, 17 Apr 2020 17:51:38 +0100 Subject: [PATCH] Re-registers no longer double connections. --- stateserver.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stateserver.py b/stateserver.py index 02b635f..f3bcdd7 100755 --- a/stateserver.py +++ b/stateserver.py @@ -275,7 +275,11 @@ def post_registerCheck() -> Any: print("found existing connection {} for {}".format(conn["connid"], conn["timeslotid"])) connection = conn + new_connection = False if connection is None: + + new_connection = True + if start_time - now_time > datetime.timedelta(hours=1): return genFail("This show too far away, please try again within an hour of starting your show.") @@ -305,7 +309,8 @@ def post_registerCheck() -> Any: subprocess.Popen(['sel', '5']) assert connection is not None - connections.append(connection) + if new_connection: + connections.append(connection) print(connections) return genPayload(connection)