1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

Exit http_server.py if it's crashed

This commit is contained in:
Andy Hayden 2018-10-19 19:15:29 -07:00 committed by Ryan Dahl
parent 3a6b2f3c71
commit 2d583f85ee

View file

@ -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)