support mc admin heal command

Signed-off-by: mujunxiang <1948535941@qq.com>
This commit is contained in:
mujunxiang
2024-11-30 21:29:37 +08:00
parent 26c5ebea53
commit 1a418c74b4
19 changed files with 388 additions and 142 deletions
+3 -3
View File
@@ -119,11 +119,11 @@ pub async fn get_local_server_property() -> ServerProperties {
network.insert(node_name, ITEM_ONLINE.to_string());
continue;
}
if !network.contains_key(&node_name) {
if let std::collections::hash_map::Entry::Vacant(e) = network.entry(node_name) {
if is_server_resolvable(endpoint).await.is_err() {
network.insert(node_name, ITEM_OFFLINE.to_string());
e.insert(ITEM_OFFLINE.to_string());
} else {
network.insert(node_name, ITEM_ONLINE.to_string());
e.insert(ITEM_ONLINE.to_string());
}
}
}