diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-05-23 16:29:02 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-05-23 16:29:02 +0200 |
commit | 5dd4544360906de246de9e33abbfd741681d2fea (patch) | |
tree | bdb1c52d7085023a827b80f99619a747d2125b95 /src | |
parent | 3e2ea02d62e0d8fd77e46e6dc5e0318584fb16dc (diff) | |
download | diplonat-5dd4544360906de246de9e33abbfd741681d2fea.tar.gz diplonat-5dd4544360906de246de9e33abbfd741681d2fea.zip |
Dockerize app
Diffstat (limited to 'src')
-rw-r--r-- | src/consul_actor.rs | 2 | ||||
-rw-r--r-- | src/main.rs | 17 |
2 files changed, 1 insertions, 18 deletions
diff --git a/src/consul_actor.rs b/src/consul_actor.rs index 877ea10..1cbb1b8 100644 --- a/src/consul_actor.rs +++ b/src/consul_actor.rs @@ -92,7 +92,7 @@ impl ConsulActor { Ok(c) => c, Err(e) => { self.consul.watch_node_reset(); - self.retries = cmp::min(u32::MAX - 1, self.retries) + 1; + self.retries = cmp::min(std::u32::MAX - 1, self.retries) + 1; let will_retry_in = retry_to_time(self.retries, Duration::from_secs(600)); error!("Failed to query consul. Will retry in {}s. {}", will_retry_in.as_secs(), e); delay_for(will_retry_in).await; diff --git a/src/main.rs b/src/main.rs index 4df32c8..a35916a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,9 +5,6 @@ mod consul_actor; mod igd_actor; mod diplonat; -//use std::net::SocketAddrV4; -//use std::collections::HashMap; -//use igd::PortMappingProtocol; use log::*; use diplonat::Diplonat; @@ -18,18 +15,4 @@ async fn main() { let mut diplo = Diplonat::new().await.expect("Setup failed"); diplo.listen().await.expect("A runtime error occured"); - -/* - let gateway = match search_gateway(Default::default()).await { - Ok(g) => g, - Err(err) => return println!("Faild to find IGD: {}", err), - }; - - let service = format!("{}:{}", config.private_ip, 1234); - let service: SocketAddrV4 = service.parse().expect("Invalid socket address"); - match gateway.add_port(PortMappingProtocol::TCP, 1234, service, config.expiration_time, "diplonat").await { - Ok(_) => (), - Err(e) => return println!("Unable to insert port 1234: {}", e), - }; - */ } |