mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-05 20:51:15 -07:00
Initialize scheduler to reconnect websocket when failed on startup
This commit is contained in:
parent
21309ba280
commit
a0799e8197
4 changed files with 6 additions and 4 deletions
|
@ -193,6 +193,7 @@ def main():
|
|||
web_socket.start_thread()
|
||||
except:
|
||||
logger.warn(u"Websocket :: Unable to open connection.")
|
||||
plexpy.initialize_scheduler()
|
||||
|
||||
# Force the http port if neccessary
|
||||
if args.port:
|
||||
|
|
|
@ -80,8 +80,9 @@ class ActivityHandler(object):
|
|||
if not session:
|
||||
return
|
||||
|
||||
logger.debug(u"PlexPy ActivityHandler :: Session %s started by user %s with ratingKey %s."
|
||||
% (str(session['session_key']), str(session['user_id']), str(session['rating_key'])))
|
||||
logger.debug(u"PlexPy ActivityHandler :: Session %s started by user %s (%) with ratingKey %s (%s)."
|
||||
% (str(session['session_key']), str(session['user_id']), session['username'],
|
||||
str(session['rating_key']), session['full_title']))
|
||||
|
||||
plexpy.NOTIFY_QUEUE.put({'stream_data': session, 'notify_action': 'on_play'})
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ def check_active_sessions(ws_request=False):
|
|||
session_list = pms_connect.get_current_activity()
|
||||
monitor_db = database.MonitorDatabase()
|
||||
monitor_process = activity_processor.ActivityProcessor()
|
||||
# logger.debug(u"PlexPy Monitor :: Checking for active streams.")
|
||||
logger.debug(u"PlexPy Monitor :: Checking for active streams.")
|
||||
|
||||
if session_list:
|
||||
media_container = session_list['sessions']
|
||||
|
|
|
@ -100,7 +100,7 @@ def run():
|
|||
|
||||
# successfully received data, reset reconnects counter
|
||||
reconnects = 0
|
||||
except (websocket.WebSocketConnectionClosedException, Exception):
|
||||
except websocket.WebSocketConnectionClosedException:
|
||||
if reconnects <= plexpy.CONFIG.WEBSOCKET_CONNECTION_ATTEMPTS:
|
||||
reconnects += 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue