rua!
This commit is contained in:
parent
f2efb6b2ff
commit
80d0b05dd7
@ -107,13 +107,12 @@ mod tests {
|
||||
}
|
||||
|
||||
fn gen_config() -> Config {
|
||||
let center_url = "openbmclapi.bangbang93.com".to_string();
|
||||
// 读取 config.toml 获得
|
||||
let raw_config = std::fs::read_to_string("config.toml").unwrap();
|
||||
let test_conf: TestConfig = toml::from_str(raw_config.as_str()).unwrap();
|
||||
|
||||
Config::new(
|
||||
center_url,
|
||||
None,
|
||||
"".to_string(),
|
||||
test_conf.cluster_port,
|
||||
test_conf.cluster_id,
|
||||
|
@ -27,7 +27,7 @@ pub struct Config {
|
||||
|
||||
impl Config {
|
||||
pub fn new(
|
||||
center_url: String,
|
||||
center_url: Option<String>,
|
||||
host_ip: String,
|
||||
host_port: u32,
|
||||
cluster_id: String,
|
||||
@ -36,7 +36,7 @@ impl Config {
|
||||
) -> Self {
|
||||
// https://openbmclapi.bangbang93.com
|
||||
Self {
|
||||
center_url,
|
||||
center_url: center_url.unwrap_or("https://openbmclapi.bangbang93.com".to_string()),
|
||||
host_ip,
|
||||
host_port,
|
||||
cluster_id,
|
||||
|
Loading…
Reference in New Issue
Block a user