forked from p15670423/monkey
Add get config value function
This commit is contained in:
parent
be8d20b2f5
commit
be8feeb3ee
|
@ -806,6 +806,14 @@ class ConfigService:
|
|||
config.pop(field, None)
|
||||
return config
|
||||
|
||||
@staticmethod
|
||||
def get_config_value(config_key_as_arr):
|
||||
config_key = reduce(lambda x, y: x+'.'+y, config_key_as_arr)
|
||||
config = mongo.db.config.find_one({'name': 'newconfig'}, {config_key: 1})
|
||||
for config_key_part in config_key_as_arr:
|
||||
config = config[config_key_part]
|
||||
return config
|
||||
|
||||
@staticmethod
|
||||
def get_flat_config():
|
||||
config_json = ConfigService.get_config()
|
||||
|
|
Loading…
Reference in New Issue