Feature/tor health checks (#426)

* wip

* wraps up core tor health check feature, still need to fix the boundaries with the rest of embassyd

* need to please borrow checker

* please the borrow checker

* wire it in

* finishes the feature

* Apply suggestions from code review

* fixes tor restart functionality

* makes tor replacement more resilient, adds embassyd service in init and replace
This commit is contained in:
Keagan McClelland
2021-08-26 17:30:22 -06:00
committed by GitHub
parent e304995c7f
commit 3160da6e9f
11 changed files with 358 additions and 46 deletions

View File

@@ -66,6 +66,8 @@ async fn inner_main(cfg_path: Option<&str>) -> Result<(), Error> {
}
});
let tor_health_check_task =
embassy::daemon::tor_health_check::tor_health_check_daemon(&rpc_ctx.net_controller.tor);
let ws_ctx = rpc_ctx.clone();
let ws_server = {
let builder = Server::bind(&ws_ctx.bind_ws);
@@ -136,6 +138,7 @@ async fn inner_main(cfg_path: Option<&str>) -> Result<(), Error> {
e.context("Health Check daemon panicked!"),
ErrorKind::Unknown
)),
futures::FutureExt::map(tor_health_check_task, Ok)
)?;
Ok(())
}