Changeset - 76ae40e514eb
[Not reviewed]
beta
0 1 0
Mads Kiilerich - 13 years ago 2013-04-03 15:56:12
madski@unity3d.com
Grafted from: d091c31cb65c
config: automatically assign instance_id for host and process if it has been set to *

It is no longer a problem to invent new instance_ids on startup - unused keys
will be deleted.
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/environment.py
Show inline comments
 
@@ -98,12 +98,18 @@ def load_environment(global_conf, app_co
 
    repos_path = make_ui('db').configitems('paths')[0][1]
 
    repo2db_mapper(ScmModel().repo_scan(repos_path),
 
                   remove_obsolete=False, install_git_hook=False)
 
    set_available_permissions(config)
 
    config['base_path'] = repos_path
 
    set_rhodecode_config(config)
 

	
 
    instance_id = rhodecode.CONFIG.get('instance_id')
 
    if instance_id == '*':
 
        instance_id = '%s-%s' % (os.uname()[1], os.getpid())
 
        rhodecode.CONFIG['instance_id'] = instance_id
 

	
 
    # CONFIGURATION OPTIONS HERE (note: all config options will override
 
    # any Pylons config options)
 

	
 
    # store config reference into our module to skip import magic of
 
    # pylons
 
    rhodecode.CONFIG.update(config)
0 comments (0 inline, 0 general)