Only force disconnect if we are connected

feature/embed-uploads
Tristan Gosselin-Hane 7 years ago
parent 34b5ea94e6
commit 968c4b0dd3
No known key found for this signature in database
GPG Key ID: 86886FC44C72EAA1
  1. 3
      webhook-bridge.py

@ -34,6 +34,7 @@ from bidict import bidict
log = logging.getLogger("bridge")
SESSION_TOKEN = ""
UUID_CACHE = bidict()
WEBHOOKS = []
BOT_USERNAME = ""
@ -182,6 +183,8 @@ def main():
PREVIOUS_PLAYER_LIST = PLAYER_LIST.copy()
ACCEPT_JOIN_EVENTS = False
PLAYER_LIST = bidict()
if connection.connected:
log.info("Forced a disconnection because the connection is still connected.")
connection.disconnect(immediate=True)
time.sleep(15)
while not is_server_online():

Loading…
Cancel
Save