mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 09:42:57 -07:00
Catch websocket expection
This commit is contained in:
parent
8f22b118be
commit
17649bf36a
1 changed files with 6 additions and 0 deletions
|
@ -90,6 +90,9 @@ def run():
|
||||||
logger.error(u"PlexPy WebSocket :: %s." % e)
|
logger.error(u"PlexPy WebSocket :: %s." % e)
|
||||||
reconnects += 1
|
reconnects += 1
|
||||||
time.sleep(plexpy.CONFIG.WEBSOCKET_CONNECTION_TIMEOUT)
|
time.sleep(plexpy.CONFIG.WEBSOCKET_CONNECTION_TIMEOUT)
|
||||||
|
except (websocket.WebSocketException, Exception) as e:
|
||||||
|
logger.error(u"PlexPy WebSocket :: %s." % e)
|
||||||
|
break
|
||||||
|
|
||||||
while plexpy.WS_CONNECTED:
|
while plexpy.WS_CONNECTED:
|
||||||
try:
|
try:
|
||||||
|
@ -116,6 +119,9 @@ def run():
|
||||||
ws.shutdown()
|
ws.shutdown()
|
||||||
plexpy.WS_CONNECTED = False
|
plexpy.WS_CONNECTED = False
|
||||||
break
|
break
|
||||||
|
except (websocket.WebSocketException, Exception) as e:
|
||||||
|
logger.error(u"PlexPy WebSocket :: %s." % e)
|
||||||
|
break
|
||||||
|
|
||||||
# Check if we recieved a restart notification and close websocket connection cleanly
|
# Check if we recieved a restart notification and close websocket connection cleanly
|
||||||
if ws_reconnect:
|
if ws_reconnect:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue