STUN actor: try to avoid ip address flapping #21

Merged
lx merged 4 commits from stun-keep-values into main 2024-01-16 15:05:01 +00:00
Showing only changes of commit 843104dad7 - Show all commits

View file

@ -120,6 +120,16 @@ impl StunAutodiscovery {
address: discovered_addr,
};
let msg = format!(
"STUN autodiscovery result: {} -> {:?}",
self.consul_key, discovered_addr
);
if self.last_result.as_ref().and_then(|x| x.address) != discovered_addr {
info!("{}", msg);
} else {
debug!("{}", msg);
}
consul
.kv_put(&self.consul_key, serde_json::to_vec(&current_result)?)
.await?;