Skip to content

Commit 1f88231

Browse files
committed
command-line option to disable GCOM-facing socket
1 parent d44cb03 commit 1f88231

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
production = True
1212
HOST, PORT, SOCKET_PORT = "localhost", 9000, 9001
1313
STATUS_HOST, STATUS_PORT = "localhost", 1323
14+
DISABLE_STATUS = False
1415
if __name__ == "__main__":
1516
# Extract arguments
1617
arguments = {}
@@ -39,6 +40,9 @@
3940

4041
if '--status-port' in arguments.keys():
4142
STATUS_PORT = arguments['--status-port'][0]
43+
44+
if '--disable-status' in arguments.keys():
45+
DISABLE_STATUS = True
4246

4347
print(f"Starting... HTTP server listening at {HOST}:{PORT}. Status WS connecting to {STATUS_HOST}:{STATUS_PORT}.")
4448

@@ -57,14 +61,17 @@
5761
gcmh_thread = Thread(target=gcmh.serve_forever, args=[production, HOST, PORT])
5862

5963
#status websocket client thread
60-
skth_thread = Thread(target=skth.connect_to, args=[production, STATUS_HOST, STATUS_PORT])
64+
if not DISABLE_STATUS:
65+
skth_thread = Thread(target=skth.connect_to, args=[production, STATUS_HOST, STATUS_PORT])
6166

6267
print("\nStarting threads...\n")
6368

6469
mpss_thread.start()
6570
gcmh_thread.start()
66-
skth_thread.start()
71+
if not DISABLE_STATUS:
72+
skth_thread.start()
6773

6874
mpss_thread.join()
6975
gcmh_thread.join()
70-
skth_thread.join()
76+
if not DISABLE_STATUS:
77+
skth_thread.join()

0 commit comments

Comments
 (0)