mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-25 10:42:58 -03:00
Fix CLI version to automatically exit when the server is shut down.
This commit is contained in:
parent
7b666654f3
commit
e33cfd621d
1 changed files with 7 additions and 10 deletions
|
@ -254,16 +254,13 @@ def main():
|
|||
print strings._("ctrlc_to_stop")
|
||||
|
||||
# wait for app to close
|
||||
running = True
|
||||
while running:
|
||||
try:
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
running = False
|
||||
web.stop()
|
||||
|
||||
# shutdown
|
||||
app.cleanup()
|
||||
try:
|
||||
t.join()
|
||||
except KeyboardInterrupt:
|
||||
web.stop(app.port)
|
||||
finally:
|
||||
# shutdown
|
||||
app.cleanup()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Reference in a new issue