mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-07 14:23:01 -04:00
Merge pull request #156 from kkka/exit-when-server-shutdown
Fix CLI to exit when server is shutdown
This commit is contained in:
commit
62d818843e
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue