mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-13 16:52:58 -07:00
Flush temporary sessions automatically if failed to check sessions on startup
This commit is contained in:
parent
e3b71a729e
commit
a5807f21b4
2 changed files with 11 additions and 4 deletions
|
@ -293,8 +293,8 @@ def connect_server(log=True, startup=False):
|
|||
|
||||
try:
|
||||
web_socket.start_thread()
|
||||
except:
|
||||
logger.error(u"Websocket :: Unable to open connection.")
|
||||
except Exception as e:
|
||||
logger.error(u"Websocket :: Unable to open connection: %s." % e)
|
||||
|
||||
|
||||
def check_server_access():
|
||||
|
|
|
@ -25,6 +25,7 @@ import plexpy
|
|||
import activity_handler
|
||||
import activity_pinger
|
||||
import activity_processor
|
||||
import database
|
||||
import logger
|
||||
|
||||
name = 'websocket'
|
||||
|
@ -33,8 +34,14 @@ ws_shutdown = False
|
|||
|
||||
|
||||
def start_thread():
|
||||
# Check for any existing sessions on start up
|
||||
activity_pinger.check_active_sessions(ws_request=True)
|
||||
try:
|
||||
# Check for any existing sessions on start up
|
||||
activity_pinger.check_active_sessions(ws_request=True)
|
||||
except Exception as e:
|
||||
logger.error(u"Tautulli WebSocket :: Failed to check for active sessions: %s." % e)
|
||||
logger.warn(u"Tautulli WebSocket :: Attempt to fix by flushing temporary sessions...")
|
||||
database.delete_sessions()
|
||||
|
||||
# Start the websocket listener on it's own thread
|
||||
thread = threading.Thread(target=run)
|
||||
thread.daemon = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue