diff --git a/apps/cic-cache/cic_cache/db/__init__.py b/apps/cic-cache/cic_cache/db/__init__.py index edc9e04b..73a5eefa 100644 --- a/apps/cic-cache/cic_cache/db/__init__.py +++ b/apps/cic-cache/cic_cache/db/__init__.py @@ -9,6 +9,7 @@ from .list import ( tag_transaction, add_tag, ) +from cic_cache.db.models.base import SessionBase logg = logging.getLogger() @@ -24,6 +25,7 @@ def dsn_from_config(config, name): database_name = '{}_{}'.format(config.get('DATABASE_PREFIX'), database_name) dsn = '' if config.get('DATABASE_ENGINE') == 'sqlite': + SessionBase.poolable = False dsn = '{}:///{}'.format( scheme, database_name, diff --git a/apps/cic-cache/cic_cache/runnable/daemons/server.py b/apps/cic-cache/cic_cache/runnable/daemons/server.py index 16eefed3..8704619c 100644 --- a/apps/cic-cache/cic_cache/runnable/daemons/server.py +++ b/apps/cic-cache/cic_cache/runnable/daemons/server.py @@ -34,7 +34,7 @@ args = argparser.parse_args() config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags) # connect to database -dsn = dsn_from_config(config) +dsn = dsn_from_config(config, 'cic_cache') SessionBase.connect(dsn, config.true('DATABASE_DEBUG')) diff --git a/apps/cic-cache/cic_cache/runnable/daemons/tasker.py b/apps/cic-cache/cic_cache/runnable/daemons/tasker.py index 9e990302..190024ce 100644 --- a/apps/cic-cache/cic_cache/runnable/daemons/tasker.py +++ b/apps/cic-cache/cic_cache/runnable/daemons/tasker.py @@ -28,7 +28,7 @@ args = argparser.parse_args() config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags) # connect to database -dsn = dsn_from_config(config) +dsn = dsn_from_config(config, 'cic_cache') SessionBase.connect(dsn) # set up celery diff --git a/apps/cic-cache/cic_cache/runnable/daemons/tracker.py b/apps/cic-cache/cic_cache/runnable/daemons/tracker.py index d5646ea9..0094b14e 100644 --- a/apps/cic-cache/cic_cache/runnable/daemons/tracker.py +++ b/apps/cic-cache/cic_cache/runnable/daemons/tracker.py @@ -50,7 +50,7 @@ args = argparser.parse_args() config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags) # connect to database -dsn = dsn_from_config(config) +dsn = dsn_from_config(config, 'cic_cache') SessionBase.connect(dsn, debug=config.true('DATABASE_DEBUG')) # set up rpc