Implement graceful shutdown (#2812)

* Remove stop status mutex
* remove some deadlocks
* Rewrite stop channel handling
* fix deadlock in peers object
* add missing test fixes
This commit is contained in:
hashmap
2019-05-15 17:51:35 +02:00
committed by Ignotus Peverell
parent 884851cdeb
commit 9ab23f6eef
23 changed files with 452 additions and 293 deletions
+1
View File
@@ -199,6 +199,7 @@ impl TUIStatusListener for TUIStatusView {
};
format!("Downloading blocks: {}%, step 4/4", percent)
}
SyncStatus::Shutdown => "Shutting down, closing connections".to_string(),
}
};
/*let basic_mining_config_status = {
+3 -1
View File
@@ -173,8 +173,10 @@ impl Controller {
while let Some(message) = self.rx.try_iter().next() {
match message {
ControllerMessage::Shutdown => {
server.stop();
self.ui.stop();
println!("Shutdown in progress, please wait");
server.stop();
return;
}
}
}