mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 14:33:00 +00:00
set default pool_recycle if using mysql
This commit is contained in:
@@ -378,6 +378,8 @@ def new_session_factory(url="sqlite:///:memory:", reset=False, **kwargs):
|
|||||||
"""Create a new session at url"""
|
"""Create a new session at url"""
|
||||||
if url.startswith('sqlite'):
|
if url.startswith('sqlite'):
|
||||||
kwargs.setdefault('connect_args', {'check_same_thread': False})
|
kwargs.setdefault('connect_args', {'check_same_thread': False})
|
||||||
|
elif url.startswith('mysql'):
|
||||||
|
kwargs.setdefault('pool_recycle', 60)
|
||||||
|
|
||||||
if url.endswith(':memory:'):
|
if url.endswith(':memory:'):
|
||||||
# If we're using an in-memory database, ensure that only one connection
|
# If we're using an in-memory database, ensure that only one connection
|
||||||
|
Reference in New Issue
Block a user