log mdns discoveries

This commit is contained in:
Alex Janka 2024-03-07 09:24:07 +11:00
parent 2ebf87272c
commit 42b742feb1

View file

@ -111,7 +111,14 @@ pub fn spawn_discover_thread() -> Result<MdnsDiscoveredList, DiscoveryError> {
None
}) {
let mut connections = discovered.write().await;
connections.insert(id, (ip.to_string(), port));
if !connections.get(&id).is_some_and(|(old_ip, old_port)| {
*old_ip == ip.to_string() && *old_port == port
}) {
log::info!(
"mdns: discovered {name} - id: {id}, ip: {ip}, port: {port}"
);
connections.insert(id, (ip.to_string(), port));
}
}
}
}