fix: Removed unused function.

This commit is contained in:
2026-10-06 16:36:30 -04:00
parent dbf98d598d
commit 8cc8189820
2 changed files with 5 additions and 30 deletions
+5
View File
@@ -1,3 +1,8 @@
## [unreleased]
### 🐛 Bug Fixes
- Status Colors on Monitor tab now reflect status of host. Closes #7
## [0.2.0] - 2026-09-24 ## [0.2.0] - 2026-09-24
### 🚀 Features ### 🚀 Features
-30
View File
@@ -1,5 +1,4 @@
use std::net::IpAddr; use std::net::IpAddr;
use tokio::task::JoinSet;
/// Perform reverse DNS lookup on a single IP. /// Perform reverse DNS lookup on a single IP.
/// Returns the hostname if found, None otherwise. /// Returns the hostname if found, None otherwise.
@@ -18,33 +17,4 @@ pub async fn reverse_lookup(ip: IpAddr) -> Option<String> {
} }
_ => None, _ => None,
} }
}
/// Perform reverse DNS lookups on a batch of IPs concurrently.
/// Returns a Vec of (IpAddr, Option<hostname>) pairs.
pub async fn reverse_lookup_batch(
ips: &[IpAddr],
max_concurrent: usize,
) -> Vec<(IpAddr, Option<String>)> {
let mut results = Vec::with_capacity(ips.len());
for chunk in ips.chunks(max_concurrent) {
let mut join_set = JoinSet::new();
for &ip in chunk {
join_set.spawn(async move {
let hostname = reverse_lookup(ip).await;
(ip, hostname)
});
}
while let Some(result) = join_set.join_next().await {
match result {
Ok(pair) => results.push(pair),
Err(e) => tracing::warn!("DNS lookup task panicked: {}", e),
}
}
}
results
} }