http server kill socket

This commit is contained in:
Adrien Beudin 2017-07-14 15:44:25 +02:00
parent 032a559b3b
commit 06e9216972

View File

@ -557,7 +557,12 @@ def main():
print('Start server on http://localhost:9000') print('Start server on http://localhost:9000')
# gracefully handle interrupt here # gracefully handle interrupt here
try:
httpd.serve_forever() httpd.serve_forever()
except (KeyboardInterrupt, SystemExit):
print('shutdown')
httpd.socket.close()
raise
if arguments['deploy']: if arguments['deploy']:
error(os.system("which rsync > /dev/null") == 0, "I can't locate the rsync, " error(os.system("which rsync > /dev/null") == 0, "I can't locate the rsync, "