From d00ec2d998772fff3829713f71ee275182c93460 Mon Sep 17 00:00:00 2001 From: donpat1to Date: Wed, 30 Jul 2025 01:02:21 +0200 Subject: [PATCH] added debugging --- WatcherAgent/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WatcherAgent/src/main.rs b/WatcherAgent/src/main.rs index 9c91deb..96ef2c3 100644 --- a/WatcherAgent/src/main.rs +++ b/WatcherAgent/src/main.rs @@ -175,13 +175,12 @@ async fn get_server_id_by_ip(base_url: &str, ip: &str) -> Result<(i32, String), } Ok(resp) if resp.status() == StatusCode::NOT_FOUND => { println!( - "❌ Server with IP {} not found in database (will retry in 30 seconds)", + "❌ Server with IP {} not found in database (will retry in 10 seconds)", ip ); sleep(Duration::from_secs(10)).await; } Ok(resp) => { - //let text = resp.text().await?; println!( "⚠️ Server responded with status: {} - {}", resp.status(), @@ -190,7 +189,7 @@ async fn get_server_id_by_ip(base_url: &str, ip: &str) -> Result<(i32, String), sleep(Duration::from_secs(10)).await; } Err(err) => { - println!("⚠️ Request failed: {} (will retry in 30 seconds)", err); + println!("⚠️ Request failed: {} (will retry in 10 seconds)", err); sleep(Duration::from_secs(10)).await; } } @@ -200,6 +199,7 @@ async fn get_server_id_by_ip(base_url: &str, ip: &str) -> Result<(i32, String), async fn register_with_server(base_url: &str) -> Result<(i32, String), Box> { // First get local IP let ip = local_ip_address::local_ip()?.to_string(); + println!("Local IP address detected: {}", ip); // Get server ID from backend (this will retry until successful) let (server_id, registered_ip) = get_server_id_by_ip(base_url, &ip).await?;