Add remaining database name prefix changes
This commit is contained in:
parent
140b72a72b
commit
995d4e0bd0
@ -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,
|
||||
|
@ -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'))
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user