Catch ctrl+c, clean shutdown
This commit is contained in:
1 parent
b75ad65de8
commit
cee0aa0bbd
2 files changed
+70
No files matched your search
@@ -218,6 +218,8 @@ def main(global_state=None, *, server=None, port=None, username=None,
|
||||
print('Connection ended.', flush=True)
|
||||
except KeyboardInterrupt:
|
||||
shutdown_requested = True
|
||||
if global_state is not None:
|
||||
global_state.running = False
|
||||
print('Disconnecting...', flush=True)
|
||||
connection.disconnect()
|
||||
finally:
|
||||
|
||||
Reference in new issue
Block a user