Add -D cli arg to tolerate disconnections on startup
This commit is contained in:
parent
43c8ad0ff6
commit
d7e18b1826
1 changed files with 6 additions and 3 deletions
9
start.py
9
start.py
|
@ -43,6 +43,9 @@ arg_parser.add_argument("--module", "-m",
|
|||
arg_parser.add_argument("--module-args", "-M",
|
||||
help="Arguments to give in action against a specific module")
|
||||
|
||||
arg_parser.add_argument("--startup-disconnects", "-D",
|
||||
help="Tolerate failed connections on startup", action="store_true")
|
||||
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
if args.version:
|
||||
|
@ -101,9 +104,9 @@ if len(server_configs):
|
|||
|
||||
for server in servers:
|
||||
if not bot.connect(server):
|
||||
sys.stderr.write("failed to connect to '%s', exiting\r\n" % (
|
||||
str(server)))
|
||||
sys.exit(1)
|
||||
log.error("Failed to connect to '%s'" % str(server))
|
||||
if not args.startup_disconnects:
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
bot.run()
|
||||
|
|
Loading…
Reference in a new issue