fix race condition in wan ip check

This commit is contained in:
Aiden McClelland
2026-03-05 15:04:28 -07:00
parent d31f762d5a
commit fd1ccc0c8c

View File

@@ -1238,8 +1238,7 @@ async fn poll_ip_info(
device_type,
Some(NetworkInterfaceType::Bridge | NetworkInterfaceType::Loopback)
) {
*prev_attempt = Some(Instant::now());
match get_wan_ipv4(iface.as_str(), &ifconfig_url).await {
let res = match get_wan_ipv4(iface.as_str(), &ifconfig_url).await {
Ok(a) => a,
Err(e) => {
tracing::error!(
@@ -1253,7 +1252,9 @@ async fn poll_ip_info(
tracing::debug!("{e:?}");
None
}
}
};
*prev_attempt = Some(Instant::now());
res
} else {
None
};