added missing client statement in register server

This commit is contained in:
2025-07-29 21:49:11 +02:00
parent 44cbeb2c27
commit fb7c896fc7
2 changed files with 7 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.37", features = ["full"] }
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"
metrics = "0.24.2"
chrono = "0.4"

View File

@@ -185,6 +185,11 @@ async fn register_with_server(base_url: &str) -> Result<(i32, String), Box<dyn E
// First get local IP
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
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
let registration = RegistrationDto {
id: server_id,
ip_address: registered_ip,
ip_address: registered_ip.clone(),
cpu_type: hardware.cpu_type,
cpu_cores: hardware.cpu_cores,
gpu_type: hardware.gpu_type,