mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Fix websocket not scheduling reconnect
This commit is contained in:
parent
35914b9a48
commit
502b807e45
1 changed files with 7 additions and 4 deletions
|
@ -74,7 +74,7 @@ def on_disconnect():
|
|||
|
||||
|
||||
def reconnect():
|
||||
shutdown()
|
||||
close()
|
||||
logger.info(u"Tautulli WebSocket :: Reconnecting websocket...")
|
||||
start_thread()
|
||||
|
||||
|
@ -82,7 +82,10 @@ def reconnect():
|
|||
def shutdown():
|
||||
global ws_shutdown
|
||||
ws_shutdown = True
|
||||
close()
|
||||
|
||||
|
||||
def close():
|
||||
logger.info(u"Tautulli WebSocket :: Disconnecting websocket...")
|
||||
plexpy.WEBSOCKET.close()
|
||||
plexpy.WS_CONNECTED = False
|
||||
|
@ -129,7 +132,7 @@ def run():
|
|||
logger.info(u"Tautulli WebSocket :: Ready")
|
||||
plexpy.WS_CONNECTED = True
|
||||
except (websocket.WebSocketException, IOError, Exception) as e:
|
||||
logger.error(u"Tautulli WebSocket :: %s." % e)
|
||||
logger.error("Tautulli WebSocket :: %s." % e)
|
||||
|
||||
if plexpy.WS_CONNECTED:
|
||||
on_connect()
|
||||
|
@ -165,7 +168,7 @@ def run():
|
|||
logger.error("Tautulli WebSocket :: %s." % e)
|
||||
|
||||
else:
|
||||
shutdown()
|
||||
close()
|
||||
break
|
||||
|
||||
except (websocket.WebSocketException, Exception) as e:
|
||||
|
@ -173,7 +176,7 @@ def run():
|
|||
break
|
||||
|
||||
logger.error("Tautulli WebSocket :: %s." % e)
|
||||
shutdown()
|
||||
close()
|
||||
break
|
||||
|
||||
if not plexpy.WS_CONNECTED and not ws_shutdown:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue