From c0e2c5cb713e3a67f115b502356778c74e9ab424 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sun, 6 Aug 2017 14:29:10 +0200 Subject: [PATCH] drop scoped_session this was an artifact of the now-removed test thread --- jupyterhub/app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 2d898dad..b89a2dd3 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -24,7 +24,6 @@ if sys.version_info[:2] < (3, 3): from jinja2 import Environment, FileSystemLoader from sqlalchemy.exc import OperationalError -from sqlalchemy.orm import scoped_session from tornado.httpclient import AsyncHTTPClient import tornado.httpserver @@ -879,8 +878,7 @@ class JupyterHub(Application): echo=self.debug_db, **self.db_kwargs ) - # trigger constructing thread local db property - self.db = scoped_session(self.session_factory)() + self.db = self.session_factory() except OperationalError as e: self.log.error("Failed to connect to db: %s", self.db_url) self.log.debug("Database error was:", exc_info=True)