# HG changeset patch # User Mads Kiilerich # Date 2013-04-03 13:56:12 # Node ID 76ae40e514eb5b773de8082f31702d476f57c601 # Parent 24e24661c0eba7be93f0e9dc3a35ea314d28ed60 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. diff --git a/rhodecode/config/environment.py b/rhodecode/config/environment.py --- a/rhodecode/config/environment.py +++ b/rhodecode/config/environment.py @@ -101,6 +101,12 @@ def load_environment(global_conf, app_co 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)