Fix CLI to exit when server is shutdown

This commit is contained in:
kkka 2014-10-05 02:42:27 +09:00
parent 381d046a94
commit f2cd447a58

View File

@ -261,8 +261,9 @@ def main():
# wait for app to close
try:
while True:
time.sleep(0.5)
while t.is_alive():
# t.join() can't catch KeyboradInterrupt in such as Ubuntu
t.join(0.5)
except KeyboardInterrupt:
web.stop(app.port)
finally: