Skip to content

Commit

Permalink
fix: do not await node removal action when multiple selected
Browse files Browse the repository at this point in the history
  • Loading branch information
bochaco committed Dec 9, 2024
1 parent 17c4282 commit 45d2528
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/node_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DEFAULT_METRICS_PORT: u16 = 14000;
const REWARDS_ADDR_LENGTH: usize = 40;

// Action to apply on a node instance
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq)]
pub enum NodeAction {
Start,
Stop,
Expand Down Expand Up @@ -141,7 +141,12 @@ pub fn NodesActionsView() -> impl IntoView {
}

action.apply(&info).await;
while !was_cancelled() && info.read().status.is_transitioning() {

// let's await for it to finish transitioning unless it was a removal action
while action != NodeAction::Remove
&& !was_cancelled()
&& info.read().status.is_transitioning()
{
sleep(Duration::from_millis(NODES_LIST_POLLING_FREQ_MILLIS)).await;
}
}
Expand Down

0 comments on commit 45d2528

Please sign in to comment.