Refactor the Monitor code.

This commit is contained in:
Tim 2015-09-22 20:02:11 +02:00
parent 28227a3c35
commit 3afa52b607
5 changed files with 173 additions and 153 deletions

View file

@ -15,7 +15,7 @@
# Mostly borrowed from https://github.com/trakt/Plex-Trakt-Scrobbler
from plexpy import logger, monitor
from plexpy import logger, activity_pinger
import threading
import plexpy
@ -29,7 +29,7 @@ opcode_data = (websocket.ABNF.OPCODE_TEXT, websocket.ABNF.OPCODE_BINARY)
def start_thread():
# Check for any existing sessions on start up
monitor.check_active_sessions(ws_request=True)
activity_pinger.check_active_sessions(ws_request=True)
# Start the websocket listener on it's own thread
threading.Thread(target=run).start()