aboutsummaryrefslogtreecommitdiff
path: root/src/proxy_config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/proxy_config.rs')
-rw-r--r--src/proxy_config.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/proxy_config.rs b/src/proxy_config.rs
index ac37229..af1f576 100644
--- a/src/proxy_config.rs
+++ b/src/proxy_config.rs
@@ -252,6 +252,7 @@ struct NodeWatchState {
pub fn spawn_proxy_config_task(
consul: Consul,
+ local_node: String,
mut must_exit: watch::Receiver<bool>,
) -> watch::Receiver<Arc<ProxyConfig>> {
let (tx, rx) = watch::channel(Arc::new(ProxyConfig {
@@ -354,12 +355,11 @@ pub fn spawn_proxy_config_task(
let mut entries = vec![];
for (node_name, watch_state) in nodes.iter() {
if let Some(catalog) = &watch_state.last_catalog {
- let same_node = *node_name == consul.local_node;
- let same_site =
- match (node_site.get(node_name), node_site.get(&consul.local_node)) {
- (Some(s1), Some(s2)) => s1 == s2,
- _ => false,
- };
+ let same_node = *node_name == local_node;
+ let same_site = match (node_site.get(node_name), node_site.get(&local_node)) {
+ (Some(s1), Some(s2)) => s1 == s2,
+ _ => false,
+ };
entries.extend(parse_consul_catalog(catalog, same_node, same_site));
}