mirror of
https://github.com/zaphar/durnitisp.git
synced 2025-07-23 18:29:49 -04:00
Cleanup unused warnings
This commit is contained in:
parent
5a47c31152
commit
1058db3716
@ -71,7 +71,7 @@ pub fn start_echo_loop(
|
|||||||
.with(&prometheus::labels! {"domain" => domain_name})
|
.with(&prometheus::labels! {"domain" => domain_name})
|
||||||
.set(r.elapsed.as_millis() as i64);
|
.set(r.elapsed.as_millis() as i64);
|
||||||
}
|
}
|
||||||
EkkoResponse::ExceededResponse(r) => {
|
EkkoResponse::ExceededResponse(_) => {
|
||||||
ping_counter
|
ping_counter
|
||||||
.with(&prometheus::labels! {"result" => "timedout", "domain" => domain_name})
|
.with(&prometheus::labels! {"result" => "timedout", "domain" => domain_name})
|
||||||
.inc();
|
.inc();
|
||||||
|
@ -179,7 +179,7 @@ fn main() -> anyhow::Result<()> {
|
|||||||
});
|
});
|
||||||
parent.adopt(Box::new(render_thread));
|
parent.adopt(Box::new(render_thread));
|
||||||
}
|
}
|
||||||
for (i, domain_name) in ping_hosts.iter().cloned().enumerate() {
|
for domain_name in ping_hosts.iter().cloned() {
|
||||||
// TODO(Prometheus stats)
|
// TODO(Prometheus stats)
|
||||||
let stop_signal = stop_signal.clone();
|
let stop_signal = stop_signal.clone();
|
||||||
let ping_latency_vec = ping_latency_vec.clone();
|
let ping_latency_vec = ping_latency_vec.clone();
|
||||||
|
22
src/util.rs
22
src/util.rs
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
|
use std::net::{SocketAddr, ToSocketAddrs};
|
||||||
|
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
@ -30,22 +30,4 @@ pub fn resolve_addrs<'a>(servers: &'a Vec<&str>) -> io::Result<Vec<Option<Socket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Ok(results);
|
return Ok(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve_ip_addrs(hosts: &Vec<&str>) -> io::Result<Vec<Option<IpAddr>>> {
|
|
||||||
let mut results = Vec::with_capacity(hosts.len());
|
|
||||||
// NOTE(jwall): This is a silly hack due to the fact that the proper way
|
|
||||||
// to do host lookups in the Rust stdlib has not settled yet.
|
|
||||||
// TODO(jwall): Do this in a less hacky method once host lookups
|
|
||||||
// are settled properly.
|
|
||||||
for host in hosts.iter().cloned() {
|
|
||||||
match format!("{}:8080", host).to_socket_addrs() {
|
|
||||||
Ok(addr) => results.push(addr.into_iter().next().map(|a| a.ip())),
|
|
||||||
Err(e) => {
|
|
||||||
info!("Failed to resolve {} with error {}", host, e);
|
|
||||||
results.push(None);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(results)
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user