mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix: only log WAN IP error when all echoip URLs fail
This commit is contained in:
@@ -1311,6 +1311,7 @@ async fn poll_ip_info(
|
||||
crate::db::model::public::default_echoip_urls()
|
||||
};
|
||||
let mut wan_ip = None;
|
||||
let mut err = None;
|
||||
for echoip_url in echoip_urls {
|
||||
if echoip_ratelimit_state
|
||||
.get(&echoip_url)
|
||||
@@ -1326,6 +1327,18 @@ async fn poll_ip_info(
|
||||
wan_ip = a;
|
||||
}
|
||||
Err(e) => {
|
||||
err = Some(e);
|
||||
}
|
||||
};
|
||||
echoip_ratelimit_state.insert(echoip_url, Instant::now());
|
||||
if wan_ip.is_some() {
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
if wan_ip.is_none()
|
||||
&& let Some(e) = err
|
||||
{
|
||||
tracing::error!(
|
||||
"{}",
|
||||
t!(
|
||||
@@ -1336,13 +1349,6 @@ async fn poll_ip_info(
|
||||
);
|
||||
tracing::debug!("{e:?}");
|
||||
}
|
||||
};
|
||||
echoip_ratelimit_state.insert(echoip_url, Instant::now());
|
||||
if wan_ip.is_some() {
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
let mut ip_info = IpInfo {
|
||||
name: name.clone(),
|
||||
scope_id,
|
||||
|
||||
Reference in New Issue
Block a user