Skip to content

Commit

Permalink
feat: update node status/metadata even when metrics could not be retr…
Browse files Browse the repository at this point in the history
…ieved
  • Loading branch information
bochaco committed Jan 13, 2025
1 parent 8902ac3 commit 62a9155
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bg_tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ async fn update_nodes_info(
let mut node_metrics = nodes_metrics.lock().await;
node_metrics.store(&node_info.container_id, &metrics).await;
node_metrics.update_node_info(&mut node_info);
update_node_metadata(&node_info, db_client, node_status_locked).await;
}
Ok(Err(err)) => {
logging::log!("Failed to fetch metrics from node {node_short_id}: {err}");
Expand All @@ -436,6 +435,9 @@ async fn update_nodes_info(
}
}

// store up to date metadata and status onto local DB cache
update_node_metadata(&node_info, db_client, node_status_locked).await;

net_size +=
node_info.connected_peers.unwrap_or_default() * node_info.net_size.unwrap_or_default();
weights += node_info.connected_peers.unwrap_or_default();
Expand Down

0 comments on commit 62a9155

Please sign in to comment.