Skip to content

Commit

Permalink
feat: add graceful shutdown of base node
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Jan 11, 2023
1 parent b3380c7 commit c9797c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion applications/tari_base_node/src/commands/cli_loop.rs
Expand Up @@ -177,7 +177,7 @@ impl CliLoop {
if let Err(err) = self.context.handle_command_str(line).await {
println!("Wrong command to watch `{}`. Failed with: {}", line, err);
} else {
loop {
while !self.done {
let interval = time::sleep(interval);
tokio::select! {
_ = interval => {
Expand All @@ -188,6 +188,9 @@ impl CliLoop {
},
_ = &mut interrupt => {
break;
},
_ = self.shutdown_signal.wait() => {
self.done = true;
}
}
}
Expand Down

0 comments on commit c9797c5

Please sign in to comment.