refactor: get_running_info fn replace status polling with direct calls (#1441)

This commit is contained in:
Mg Pig
2025-10-04 21:43:34 +08:00
committed by GitHub
parent 5e48626cb9
commit 4d5330fa0a
13 changed files with 181 additions and 118 deletions
+1 -1
View File
@@ -202,7 +202,7 @@ pub unsafe extern "C" fn collect_network_infos(
std::slice::from_raw_parts_mut(infos, max_length)
};
let collected_infos = match INSTANCE_MANAGER.collect_network_infos() {
let collected_infos = match INSTANCE_MANAGER.collect_network_infos_sync() {
Ok(infos) => infos,
Err(e) => {
set_error_msg(&format!("failed to collect network infos: {}", e));
@@ -497,7 +497,7 @@ impl HealthChecker {
instance_mgr: Arc<NetworkInstanceManager>,
// return version, response time on healthy, conn_count
) -> anyhow::Result<(String, u64, u32)> {
let Some(instance) = instance_mgr.get_network_info(&inst_id) else {
let Some(instance) = instance_mgr.get_network_info(&inst_id).await else {
anyhow::bail!("healthy check node is not started");
};