config changed + using preboot remote server
parent
cc8d949dc4
commit
529247a839
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"dateOfCreation": "1721381809112",
|
"dateOfCreation": "1721381809112",
|
||||||
"configServer": "192.168.2.37",
|
|
||||||
"processes": [
|
"processes": [
|
||||||
{
|
{
|
||||||
"name": "temp-process",
|
"name": "temp-process",
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ pub mod v2 {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
match get_redis_connection(&local_config.config_server).await {
|
match get_redis_connection(¶ms.remote_server_url).await {
|
||||||
Some(mut conn) => {
|
Some(mut conn) => {
|
||||||
let mut pub_sub = conn.as_pubsub();
|
let mut pub_sub = conn.as_pubsub();
|
||||||
let channel_name = get_container_id().unwrap_or(String::from("default"));
|
let channel_name = get_container_id().unwrap_or(String::from("default"));
|
||||||
|
|
@ -879,13 +879,11 @@ mod config_unittests {
|
||||||
// old one (kinda local)
|
// old one (kinda local)
|
||||||
let a = Processes {
|
let a = Processes {
|
||||||
date_of_creation: String::from("1"),
|
date_of_creation: String::from("1"),
|
||||||
config_server: String::new(),
|
|
||||||
processes: vec![],
|
processes: vec![],
|
||||||
};
|
};
|
||||||
// new one (kinda remote)
|
// new one (kinda remote)
|
||||||
let b = Processes {
|
let b = Processes {
|
||||||
date_of_creation: String::from("2"),
|
date_of_creation: String::from("2"),
|
||||||
config_server: String::new(),
|
|
||||||
processes: vec![],
|
processes: vec![],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -900,7 +898,6 @@ mod config_unittests {
|
||||||
fn save_config() {
|
fn save_config() {
|
||||||
let a = Processes {
|
let a = Processes {
|
||||||
date_of_creation: String::from("1"),
|
date_of_creation: String::from("1"),
|
||||||
config_server: String::new(),
|
|
||||||
processes: vec![],
|
processes: vec![],
|
||||||
};
|
};
|
||||||
assert!(save_new_config(&a, "tests/examples/save-conf.json").is_ok());
|
assert!(save_new_config(&a, "tests/examples/save-conf.json").is_ok());
|
||||||
|
|
@ -910,7 +907,6 @@ mod config_unittests {
|
||||||
fn save_to_zero_file() {
|
fn save_to_zero_file() {
|
||||||
let a = Processes {
|
let a = Processes {
|
||||||
date_of_creation: String::from("1"),
|
date_of_creation: String::from("1"),
|
||||||
config_server: String::new(),
|
|
||||||
processes: vec![],
|
processes: vec![],
|
||||||
};
|
};
|
||||||
assert!(save_new_config(&a, "tests/examples/none.json").is_ok());
|
assert!(save_new_config(&a, "tests/examples/none.json").is_ok());
|
||||||
|
|
|
||||||
|
|
@ -141,8 +141,6 @@ pub struct Processes {
|
||||||
// runner_id: usize,
|
// runner_id: usize,
|
||||||
#[serde(rename = "dateOfCreation")]
|
#[serde(rename = "dateOfCreation")]
|
||||||
pub date_of_creation: String,
|
pub date_of_creation: String,
|
||||||
#[serde(rename = "configServer")]
|
|
||||||
pub config_server: String,
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub processes: Vec<TrackingProcess>,
|
pub processes: Vec<TrackingProcess>,
|
||||||
}
|
}
|
||||||
|
|
@ -151,7 +149,6 @@ impl Default for Processes {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
date_of_creation : String::new(),
|
date_of_creation : String::new(),
|
||||||
config_server : String::from("default"),
|
|
||||||
processes : Vec::new(),
|
processes : Vec::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue