Skip to content

Commit

Permalink
fix(launchpad): stopping nodes before removing
Browse files Browse the repository at this point in the history
  • Loading branch information
mazzi committed Nov 15, 2024
1 parent 2ebd136 commit d2ec8d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion node-launchpad/src/components/popup/manage_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl Component for ManageNodes {
let help = Paragraph::new(vec![
Line::raw(format!(
"Note: Each node will use a small amount of CPU Memory and Network Bandwidth. \
We recommend starting no more than 5 at a time (max {MAX_NODE_COUNT} nodes)."
We recommend starting no more than 2 at a time (max {MAX_NODE_COUNT} nodes)."
)),
Line::raw(""),
Line::raw("▲▼ to change the number of nodes to start."),
Expand Down
15 changes: 15 additions & 0 deletions node-launchpad/src/node_mgmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,21 @@ async fn upgrade_nodes(args: UpgradeNodesArgs) {
}

async fn remove_nodes(services: Vec<String>, action_sender: UnboundedSender<Action>) {
// First we stop the nodes
if let Err(err) =
sn_node_manager::cmd::node::stop(None, vec![], services.clone(), VerbosityLevel::Minimal)
.await
{
error!("Error while stopping services {err:?}");
send_action(
action_sender.clone(),
Action::StatusActions(StatusActions::ErrorRemovingNodes {
services: services.clone(),
raw_error: err.to_string(),
}),
);
}

if let Err(err) =
sn_node_manager::cmd::node::remove(false, vec![], services.clone(), VerbosityLevel::Minimal)
.await
Expand Down

0 comments on commit d2ec8d7

Please sign in to comment.