From 11aa8757a680bf0cb4f45b454cea475180ba79f7 Mon Sep 17 00:00:00 2001 From: Tristan Gosselin-Hane Date: Wed, 7 Nov 2018 19:34:30 -0500 Subject: [PATCH] Don't give up on reconnecting if the server is down at the very start (in offline mode this time) --- webhook-bridge.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webhook-bridge.py b/webhook-bridge.py index a0408e1..2c93e70 100755 --- a/webhook-bridge.py +++ b/webhook-bridge.py @@ -148,7 +148,7 @@ def main(): time.sleep(15) while not is_server_online(): logging.info('Not reconnecting to server because it appears to be offline.') - time.sleep(5) + time.sleep(15) logging.info('Reconnecting.') connection.connect() @@ -176,9 +176,9 @@ def main(): if not config.mc_online: logging.info("Connecting in offline mode...") - 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) BOT_USERNAME = config.mc_username connection = Connection( config.mc_server, config.mc_port, username=config.mc_username,