aboutsummaryrefslogtreecommitdiff
path: root/src/consul_actor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/consul_actor.rs')
-rw-r--r--src/consul_actor.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/consul_actor.rs b/src/consul_actor.rs
index 61789ca..8b722b6 100644
--- a/src/consul_actor.rs
+++ b/src/consul_actor.rs
@@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize};
use serde_lexpr::{error, from_str};
use tokio::{sync::watch, time::sleep};
+use crate::config::RuntimeConfigConsul;
use crate::{consul, messages};
#[derive(Serialize, Deserialize, Debug)]
@@ -74,14 +75,14 @@ fn to_open_ports(params: &Vec<DiplonatConsul>) -> messages::PublicExposedPorts {
}
impl ConsulActor {
- pub fn new(url: &str, node: &str) -> Self {
+ pub fn new(config: &RuntimeConfigConsul, node: &str) -> Self {
let (tx, rx) = watch::channel(messages::PublicExposedPorts {
tcp_ports: HashSet::new(),
udp_ports: HashSet::new(),
});
return Self {
- consul: consul::Consul::new(url),
+ consul: consul::Consul::new(config),
rx_open_ports: rx,
tx_open_ports: tx,
node: node.to_string(),