Make sure server definitely quits with timeout.
This commit is contained in:
parent
076440d7c8
commit
c82b19309a
1 changed files with 3 additions and 2 deletions
|
@ -35,7 +35,7 @@ def startServer(notifications=False):
|
||||||
|
|
||||||
if server and server.is_alive():
|
if server and server.is_alive():
|
||||||
server.terminate()
|
server.terminate()
|
||||||
server.join()
|
server.join(timeout=20) # If we somehow get stuck stopping BAPSicle let it die.
|
||||||
|
|
||||||
# Catch the handler being killed externally.
|
# Catch the handler being killed externally.
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -43,7 +43,7 @@ def startServer(notifications=False):
|
||||||
type(e).__name__, e.args))
|
type(e).__name__, e.args))
|
||||||
if server and server.is_alive():
|
if server and server.is_alive():
|
||||||
server.terminate()
|
server.terminate()
|
||||||
server.join()
|
server.join(timeout=20)
|
||||||
|
|
||||||
|
|
||||||
def printer(msg: Any):
|
def printer(msg: Any):
|
||||||
|
@ -81,3 +81,4 @@ if __name__ == "__main__":
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
startServer()
|
startServer()
|
||||||
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in a new issue