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 # wait for app to close
try: try:
while True: while t.is_alive():
time.sleep(0.5) # t.join() can't catch KeyboradInterrupt in such as Ubuntu
t.join(0.5)
except KeyboardInterrupt: except KeyboardInterrupt:
web.stop(app.port) web.stop(app.port)
finally: finally: