added missing client statement in register server
This commit is contained in:
@@ -11,7 +11,7 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
tokio = { version = "1.37", features = ["full"] }
|
tokio = { version = "1.37", features = ["full"] }
|
||||||
local-ip-address = "0.5"
|
local-ip-address = "0.5"
|
||||||
reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "cookies", "rustls-tls", "statuscode"] }
|
reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "cookies", "rustls-tls"] }
|
||||||
sysinfo = "0.29"
|
sysinfo = "0.29"
|
||||||
metrics = "0.24.2"
|
metrics = "0.24.2"
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
|
@@ -185,6 +185,11 @@ async fn register_with_server(base_url: &str) -> Result<(i32, String), Box<dyn E
|
|||||||
// First get local IP
|
// First get local IP
|
||||||
let ip = local_ip_address::local_ip()?.to_string();
|
let ip = local_ip_address::local_ip()?.to_string();
|
||||||
|
|
||||||
|
// Create HTTP client
|
||||||
|
let client = Client::builder()
|
||||||
|
.danger_accept_invalid_certs(true)
|
||||||
|
.build()?;
|
||||||
|
|
||||||
// Get server ID from backend
|
// Get server ID from backend
|
||||||
let (server_id, registered_ip) = get_server_id_by_ip(base_url, &ip).await?;
|
let (server_id, registered_ip) = get_server_id_by_ip(base_url, &ip).await?;
|
||||||
|
|
||||||
@@ -194,7 +199,7 @@ async fn register_with_server(base_url: &str) -> Result<(i32, String), Box<dyn E
|
|||||||
// Send registration data
|
// Send registration data
|
||||||
let registration = RegistrationDto {
|
let registration = RegistrationDto {
|
||||||
id: server_id,
|
id: server_id,
|
||||||
ip_address: registered_ip,
|
ip_address: registered_ip.clone(),
|
||||||
cpu_type: hardware.cpu_type,
|
cpu_type: hardware.cpu_type,
|
||||||
cpu_cores: hardware.cpu_cores,
|
cpu_cores: hardware.cpu_cores,
|
||||||
gpu_type: hardware.gpu_type,
|
gpu_type: hardware.gpu_type,
|
||||||
|
Reference in New Issue
Block a user