mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 11:53:59 -05:00
Exit http_server.py if it's crashed
This commit is contained in:
parent
3a6b2f3c71
commit
2d583f85ee
1 changed files with 6 additions and 4 deletions
|
@ -53,12 +53,14 @@ def spawn():
|
||||||
r_thread.daemon = True
|
r_thread.daemon = True
|
||||||
r_thread.start()
|
r_thread.start()
|
||||||
sleep(1) # TODO I'm too lazy to figure out how to do this properly.
|
sleep(1) # TODO I'm too lazy to figure out how to do this properly.
|
||||||
|
return thread
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
spawn()
|
thread = spawn()
|
||||||
while True:
|
while thread.is_alive():
|
||||||
sleep(100)
|
sleep(10)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
sys.exit()
|
pass
|
||||||
|
sys.exit(1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue