Fix plexWatch db importer.
Always return None on exception in http handler. Increase websocket retry counts.
This commit is contained in:
@@ -81,10 +81,11 @@ class HTTPHandler(object):
|
||||
logger.warn(u"Failed to access uri endpoint %s with error %s" % (uri, e))
|
||||
return None
|
||||
except Exception, e:
|
||||
logger.warn(u"Failed to access uri endpoint %s. Is your server maybe accepting SSL connections only?" % uri)
|
||||
logger.warn(u"Failed to access uri endpoint %s. Is your server maybe accepting SSL connections only? %s" % (uri, e))
|
||||
return None
|
||||
except:
|
||||
logger.warn(u"Failed to access uri endpoint %s with Uncaught exception." % uri)
|
||||
return None
|
||||
|
||||
if request_status == 200:
|
||||
if output_format == 'dict':
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
import sqlite3
|
||||
|
||||
from plexpy import logger, helpers, monitor, users, plextv
|
||||
from plexpy import logger, helpers, activity_pinger, activity_processor, users, plextv
|
||||
from xml.dom import minidom
|
||||
|
||||
import plexpy
|
||||
@@ -245,9 +245,10 @@ def import_from_plexwatch(database=None, table_name=None, import_ignore_interval
|
||||
logger.debug(u"PlexPy Importer :: PlexWatch data import in progress...")
|
||||
|
||||
logger.debug(u"PlexPy Importer :: Disabling monitoring while import in progress.")
|
||||
plexpy.schedule_job(monitor.check_active_sessions, 'Check for active sessions', hours=0, minutes=0, seconds=0)
|
||||
plexpy.schedule_job(activity_pinger.check_active_sessions, 'Check for active sessions',
|
||||
hours=0, minutes=0, seconds=0)
|
||||
|
||||
monitor_processing = monitor.MonitorProcessing()
|
||||
ap = activity_processor.ActivityProcessor()
|
||||
user_data = users.Users()
|
||||
|
||||
# Get the latest friends list so we can pull user id's
|
||||
@@ -373,7 +374,7 @@ def import_from_plexwatch(database=None, table_name=None, import_ignore_interval
|
||||
# On older versions of PMS, "clip" items were still classified as "movie" and had bad ratingKey values
|
||||
# Just make sure that the ratingKey is indeed an integer
|
||||
if session_history_metadata['rating_key'].isdigit():
|
||||
monitor_processing.write_session_history(session=session_history,
|
||||
ap.write_session_history(session=session_history,
|
||||
import_metadata=session_history_metadata,
|
||||
is_import=True,
|
||||
import_ignore_interval=import_ignore_interval)
|
||||
|
@@ -50,7 +50,7 @@ def run():
|
||||
reconnects = 0
|
||||
|
||||
# Try an open the websocket connection - if it fails after 5 retries fallback to polling
|
||||
while not ws_connected and reconnects < 5:
|
||||
while not ws_connected and reconnects < 15:
|
||||
try:
|
||||
logger.info(u'PlexPy WebSocket :: Opening websocket, connection attempt %s.' % str(reconnects + 1))
|
||||
ws = create_connection(uri)
|
||||
|
Reference in New Issue
Block a user