From 937866234da48ce50bf3e1c190b8e708bd225d41 Mon Sep 17 00:00:00 2001 From: Tristan Gosselin-Hane Date: Wed, 7 Nov 2018 18:21:41 -0500 Subject: [PATCH] Don't give up on reconnecting if the server is down at the very start --- webhook-bridge.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webhook-bridge.py b/webhook-bridge.py index 4999d1b..bea931c 100755 --- a/webhook-bridge.py +++ b/webhook-bridge.py @@ -186,9 +186,9 @@ def main(): sys.exit() BOT_USERNAME = auth_token.username logging.info("Logged in as %s..." % auth_token.username) - if not is_server_online(): + while not is_server_online(): logging.info('Not connecting to server because it appears to be offline.') - sys.exit(1) + time.sleep(15) connection = Connection( config.mc_server, config.mc_port, auth_token=auth_token, handle_exception=minecraft_handle_exception)