mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-26 13:38:51 +00:00
Adapt Forez groups specification for Microservices
This commit is contained in:
parent
b7a0208e71
commit
c782f64602
@ -81,5 +81,4 @@ admin-url: http://localhost:3001
|
||||
# This option allows to enable some extra features for these groups
|
||||
#
|
||||
# In most cases you should not have to specify this information
|
||||
forez_groups:
|
||||
- 32
|
||||
forez_groups: 32
|
@ -140,6 +140,16 @@ impl Config {
|
||||
})
|
||||
};
|
||||
|
||||
let forez_groups = match &parsed["forez_groups"] {
|
||||
Yaml::BadValue => vec![],
|
||||
_ => {
|
||||
Self::yaml_str(parsed, "forez_groups")
|
||||
.split(",")
|
||||
.map(|f| GroupID::new(f.trim().parse::<u64>().unwrap()))
|
||||
.collect()
|
||||
}
|
||||
};
|
||||
|
||||
let conf = Config {
|
||||
port: Config::yaml_u64(parsed, "server-port"),
|
||||
listen_address: Config::yaml_str(parsed, "server-address"),
|
||||
@ -173,12 +183,7 @@ impl Config {
|
||||
|
||||
admin_url: Self::yaml_str(parsed, "admin-url"),
|
||||
|
||||
forez_groups: parsed["forez_groups"]
|
||||
.as_vec()
|
||||
.unwrap_or(&vec![])
|
||||
.iter()
|
||||
.map(|f| GroupID::new(f.as_i64().unwrap() as u64))
|
||||
.collect(),
|
||||
forez_groups,
|
||||
};
|
||||
|
||||
// Save new configuration in memory
|
||||
|
Loading…
Reference in New Issue
Block a user