Add remaining database name prefix changes
This commit is contained in:
parent
140b72a72b
commit
995d4e0bd0
@ -9,6 +9,7 @@ from .list import (
|
|||||||
tag_transaction,
|
tag_transaction,
|
||||||
add_tag,
|
add_tag,
|
||||||
)
|
)
|
||||||
|
from cic_cache.db.models.base import SessionBase
|
||||||
|
|
||||||
|
|
||||||
logg = logging.getLogger()
|
logg = logging.getLogger()
|
||||||
@ -24,6 +25,7 @@ def dsn_from_config(config, name):
|
|||||||
database_name = '{}_{}'.format(config.get('DATABASE_PREFIX'), database_name)
|
database_name = '{}_{}'.format(config.get('DATABASE_PREFIX'), database_name)
|
||||||
dsn = ''
|
dsn = ''
|
||||||
if config.get('DATABASE_ENGINE') == 'sqlite':
|
if config.get('DATABASE_ENGINE') == 'sqlite':
|
||||||
|
SessionBase.poolable = False
|
||||||
dsn = '{}:///{}'.format(
|
dsn = '{}:///{}'.format(
|
||||||
scheme,
|
scheme,
|
||||||
database_name,
|
database_name,
|
||||||
|
@ -34,7 +34,7 @@ args = argparser.parse_args()
|
|||||||
config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags)
|
config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags)
|
||||||
|
|
||||||
# connect to database
|
# connect to database
|
||||||
dsn = dsn_from_config(config)
|
dsn = dsn_from_config(config, 'cic_cache')
|
||||||
SessionBase.connect(dsn, config.true('DATABASE_DEBUG'))
|
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)
|
config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags)
|
||||||
|
|
||||||
# connect to database
|
# connect to database
|
||||||
dsn = dsn_from_config(config)
|
dsn = dsn_from_config(config, 'cic_cache')
|
||||||
SessionBase.connect(dsn)
|
SessionBase.connect(dsn)
|
||||||
|
|
||||||
# set up celery
|
# set up celery
|
||||||
|
@ -50,7 +50,7 @@ args = argparser.parse_args()
|
|||||||
config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags)
|
config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags)
|
||||||
|
|
||||||
# connect to database
|
# connect to database
|
||||||
dsn = dsn_from_config(config)
|
dsn = dsn_from_config(config, 'cic_cache')
|
||||||
SessionBase.connect(dsn, debug=config.true('DATABASE_DEBUG'))
|
SessionBase.connect(dsn, debug=config.true('DATABASE_DEBUG'))
|
||||||
|
|
||||||
# set up rpc
|
# set up rpc
|
||||||
|
Loading…
Reference in New Issue
Block a user