Check cloud status on startup before connecting websocket

This commit is contained in:
JonnyWong16
2018-02-14 06:55:44 -08:00
parent a5d2467bfe
commit a53afe05a2
3 changed files with 13 additions and 3 deletions

View File

@@ -32,7 +32,13 @@ opcode_data = (websocket.ABNF.OPCODE_TEXT, websocket.ABNF.OPCODE_BINARY)
ws_reconnect = False
def start_thread():
def start_thread(startup=False):
if startup and plexpy.CONFIG.PMS_IS_CLOUD and plexpy.PLEX_SERVER_UP is None:
plexpy.PLEX_SERVER_UP = activity_pinger.check_cloud_status(log=True, return_status=True)
if not plexpy.PLEX_SERVER_UP:
on_disconnect()
return
if plexpy.CONFIG.FIRST_RUN_COMPLETE:
# Check for any existing sessions on start up
activity_pinger.check_active_sessions(ws_request=True)