mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
fix race condition in wan ip check
This commit is contained in:
@@ -1238,8 +1238,7 @@ async fn poll_ip_info(
|
|||||||
device_type,
|
device_type,
|
||||||
Some(NetworkInterfaceType::Bridge | NetworkInterfaceType::Loopback)
|
Some(NetworkInterfaceType::Bridge | NetworkInterfaceType::Loopback)
|
||||||
) {
|
) {
|
||||||
*prev_attempt = Some(Instant::now());
|
let res = match get_wan_ipv4(iface.as_str(), &ifconfig_url).await {
|
||||||
match get_wan_ipv4(iface.as_str(), &ifconfig_url).await {
|
|
||||||
Ok(a) => a,
|
Ok(a) => a,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
@@ -1253,7 +1252,9 @@ async fn poll_ip_info(
|
|||||||
tracing::debug!("{e:?}");
|
tracing::debug!("{e:?}");
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
*prev_attempt = Some(Instant::now());
|
||||||
|
res
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user