diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-07 14:28:29 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-07 14:28:29 +0100 |
commit | fad172e54af7a4d043410fe6cdc1f8b6112e9c0f (patch) | |
tree | e2b4a63a43d19161fb36b625e6e24af37e1f709b /src/proxy_config.rs | |
parent | 752593e2747f64a8f14de3484ab085ed5f65cd40 (diff) | |
download | tricot-fad172e54af7a4d043410fe6cdc1f8b6112e9c0f.tar.gz tricot-fad172e54af7a4d043410fe6cdc1f8b6112e9c0f.zip |
Externalise Consul module to df-consul crate
Diffstat (limited to 'src/proxy_config.rs')
-rw-r--r-- | src/proxy_config.rs | 12 |
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)); } |