mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-26 07:19:22 +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
|
# This option allows to enable some extra features for these groups
|
||||||
#
|
#
|
||||||
# In most cases you should not have to specify this information
|
# In most cases you should not have to specify this information
|
||||||
forez_groups:
|
forez_groups: 32
|
||||||
- 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 {
|
let conf = Config {
|
||||||
port: Config::yaml_u64(parsed, "server-port"),
|
port: Config::yaml_u64(parsed, "server-port"),
|
||||||
listen_address: Config::yaml_str(parsed, "server-address"),
|
listen_address: Config::yaml_str(parsed, "server-address"),
|
||||||
@ -173,12 +183,7 @@ impl Config {
|
|||||||
|
|
||||||
admin_url: Self::yaml_str(parsed, "admin-url"),
|
admin_url: Self::yaml_str(parsed, "admin-url"),
|
||||||
|
|
||||||
forez_groups: parsed["forez_groups"]
|
forez_groups,
|
||||||
.as_vec()
|
|
||||||
.unwrap_or(&vec![])
|
|
||||||
.iter()
|
|
||||||
.map(|f| GroupID::new(f.as_i64().unwrap() as u64))
|
|
||||||
.collect(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Save new configuration in memory
|
// Save new configuration in memory
|
||||||
|
Loading…
Reference in New Issue
Block a user