comparison rhodecode/config/environment.py @ 3650:76ae40e514eb beta

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.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 03 Apr 2013 15:56:12 +0200
parents 99c093d1a142
children 3563bb7b4b82 88f11b5eb6db
comparison
equal deleted inserted replaced
3649:24e24661c0eb 3650:76ae40e514eb
99 repo2db_mapper(ScmModel().repo_scan(repos_path), 99 repo2db_mapper(ScmModel().repo_scan(repos_path),
100 remove_obsolete=False, install_git_hook=False) 100 remove_obsolete=False, install_git_hook=False)
101 set_available_permissions(config) 101 set_available_permissions(config)
102 config['base_path'] = repos_path 102 config['base_path'] = repos_path
103 set_rhodecode_config(config) 103 set_rhodecode_config(config)
104
105 instance_id = rhodecode.CONFIG.get('instance_id')
106 if instance_id == '*':
107 instance_id = '%s-%s' % (os.uname()[1], os.getpid())
108 rhodecode.CONFIG['instance_id'] = instance_id
109
104 # CONFIGURATION OPTIONS HERE (note: all config options will override 110 # CONFIGURATION OPTIONS HERE (note: all config options will override
105 # any Pylons config options) 111 # any Pylons config options)
106 112
107 # store config reference into our module to skip import magic of 113 # store config reference into our module to skip import magic of
108 # pylons 114 # pylons