summaryrefslogtreecommitdiff
path: root/tools/http_server.py
diff options
context:
space:
mode:
authorAndy Hayden <andyhayden1@gmail.com>2018-10-19 19:15:29 -0700
committerRyan Dahl <ry@tinyclouds.org>2018-10-20 00:27:37 -0400
commit2d583f85ee6ef740c1f13e44364d2a55ec6c0c31 (patch)
treebc92ecba0234425b1a57a5ad191db4a84ef25690 /tools/http_server.py
parent3a6b2f3c7163d228a318a8eb855b194edb0eb18d (diff)
Exit http_server.py if it's crashed
Diffstat (limited to 'tools/http_server.py')
-rwxr-xr-xtools/http_server.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/http_server.py b/tools/http_server.py
index 222410c15..c96b070e6 100755
--- a/tools/http_server.py
+++ b/tools/http_server.py
@@ -53,12 +53,14 @@ def spawn():
r_thread.daemon = True
r_thread.start()
sleep(1) # TODO I'm too lazy to figure out how to do this properly.
+ return thread
if __name__ == '__main__':
try:
- spawn()
- while True:
- sleep(100)
+ thread = spawn()
+ while thread.is_alive():
+ sleep(10)
except KeyboardInterrupt:
- sys.exit()
+ pass
+ sys.exit(1)