Fix CLI version to automatically exit when the server is shut down.

This commit is contained in:
kkka 2014-09-07 10:33:52 +09:00
parent 7b666654f3
commit e33cfd621d

View File

@ -254,16 +254,13 @@ def main():
print strings._("ctrlc_to_stop") print strings._("ctrlc_to_stop")
# wait for app to close # wait for app to close
running = True try:
while running: t.join()
try: except KeyboardInterrupt:
time.sleep(0.5) web.stop(app.port)
except KeyboardInterrupt: finally:
running = False # shutdown
web.stop() app.cleanup()
# shutdown
app.cleanup()
if __name__ == '__main__': if __name__ == '__main__':
main() main()