added debugging
This commit is contained in:
@@ -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<dyn Error>> {
|
||||
// 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?;
|
||||
|
Reference in New Issue
Block a user