Merge pull request #156 from kkka/exit-when-server-shutdown

Fix CLI to exit when server is shutdown
This commit is contained in:
Micah Lee 2014-11-17 10:31:57 -08:00
commit 62d818843e

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: