more grace

more graceful shutdown and error handling
This commit is contained in:
Brian Martin 2019-06-07 00:54:12 -04:00
parent 4e46d7e810
commit 6c429b93e6
5 changed files with 86 additions and 50 deletions

View file

@ -7,11 +7,11 @@ import asyncio
if __name__ == "__main__":
try:
parser = argparse.ArgumentParser()
parser.add_argument("--listen", type=str, default=None, help="listen address")
parser.add_argument("--listen", type=str, default=None, help="start serving on address")
parser.add_argument(
"--announce", type=str, default=None, help="announce address (for bot)"
"--announce", type=str, default=None, help="announce address to bots on checkin"
)
parser.add_argument("--debug", action="store_true")
parser.add_argument("--debug", action="store_true", help="enable debug logs")
args = parser.parse_args()
if args.debug:
@ -29,5 +29,9 @@ if __name__ == "__main__":
bumper.bumperlog.info("Keyboard Interrupt!")
pass
except Exception as e:
bumper.bumperlog.Exception(e)
pass
finally:
asyncio.run(bumper.shutdown())