forked from platypush/platypush
Handle KeyboardInterrupt
and process return code in the main.
This commit is contained in:
parent
8819a0ed4c
commit
c11bc69a66
1 changed files with 12 additions and 1 deletions
|
@ -321,7 +321,18 @@ def main(*args: str):
|
||||||
Application entry point.
|
Application entry point.
|
||||||
"""
|
"""
|
||||||
app = Application.from_cmdline(args)
|
app = Application.from_cmdline(args)
|
||||||
|
|
||||||
|
try:
|
||||||
app.run()
|
app.run()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
|
||||||
|
log.info('Application stopped')
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main(*sys.argv[1:]))
|
||||||
|
|
||||||
|
|
||||||
# vim:sw=4:ts=4:et:
|
# vim:sw=4:ts=4:et:
|
||||||
|
|
Loading…
Reference in a new issue