From 2bfa770f608d10a4469d8ec0ed1d51a218ae2ba1 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Wed, 27 Apr 2016 00:47:03 -0700 Subject: [PATCH] Hacky solution to exclude cherrypy threads from sessions --- plexpy/session.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plexpy/session.py b/plexpy/session.py index b557b517..eb5238f1 100644 --- a/plexpy/session.py +++ b/plexpy/session.py @@ -14,6 +14,7 @@ # along with PlexPy. If not, see . import cherrypy +import threading from plexpy import common @@ -24,7 +25,8 @@ def get_session_info(): """ from plexpy.webauth import SESSION_KEY - if cherrypy.config.get('tools.sessions.on'): + # Hacky solution to exclude not cherrypy threads from sessions + if 'CP Server' in threading.current_thread().name and cherrypy.config.get('tools.sessions.on'): _session = cherrypy.session.get(SESSION_KEY) if _session: return _session