##// END OF EJS Templates
db: Move database initialization up to pyramid....
johbo -
r115:be1c5590 default
parent child Browse files
Show More
@@ -145,10 +145,6 b' def load_environment(global_conf, app_co'
145 protocol=utils.get_vcs_server_protocol(config),
145 protocol=utils.get_vcs_server_protocol(config),
146 log_level=config['vcs.server.log_level'])
146 log_level=config['vcs.server.log_level'])
147
147
148 # MULTIPLE DB configs
149 # Setup the SQLAlchemy database engine
150 utils.initialize_database(config)
151
152 set_available_permissions(config)
148 set_available_permissions(config)
153 db_cfg = make_db_config(clear_session=True)
149 db_cfg = make_db_config(clear_session=True)
154
150
@@ -36,7 +36,7 b' from routes.middleware import RoutesMidd'
36 import routes.util
36 import routes.util
37
37
38 import rhodecode
38 import rhodecode
39 from rhodecode.config import patches
39 from rhodecode.config import patches, utils
40 from rhodecode.config.environment import load_environment
40 from rhodecode.config.environment import load_environment
41 from rhodecode.lib.middleware import csrf
41 from rhodecode.lib.middleware import csrf
42 from rhodecode.lib.middleware.appenlight import wrap_in_appenlight_if_enabled
42 from rhodecode.lib.middleware.appenlight import wrap_in_appenlight_if_enabled
@@ -157,6 +157,11 b' def make_pyramid_app(global_config, **se'
157 # behavior in the old application.
157 # behavior in the old application.
158 settings_pylons = settings.copy()
158 settings_pylons = settings.copy()
159
159
160 # TODO: Remove this by refactoring the init DB function.
161 # Put debug flag into settings for DB setup.
162 settings['debug'] = global_config.get('debug', False)
163 utils.initialize_database(settings)
164
160 sanitize_settings_and_apply_defaults(settings)
165 sanitize_settings_and_apply_defaults(settings)
161 config = Configurator(settings=settings)
166 config = Configurator(settings=settings)
162 add_pylons_compat_data(config.registry, global_config, settings_pylons)
167 add_pylons_compat_data(config.registry, global_config, settings_pylons)
General Comments 0
You need to be logged in to leave comments. Login now