diff --git a/validator/src/network/tendermint.rs b/validator/src/network/tendermint.rs index 2f3d2b924a..4a581774e6 100644 --- a/validator/src/network/tendermint.rs +++ b/validator/src/network/tendermint.rs @@ -21,8 +21,8 @@ impl Abci { Abci { count: 0 } } - pub fn run(self) { - tokio::spawn(async { abci::run_local(self) }) + pub async fn run(self) { + abci::run_local(self); } } diff --git a/validator/src/services/mixmining/health_check_runner.rs b/validator/src/services/mixmining/health_check_runner.rs index c2bd6c7b18..42a3821cea 100644 --- a/validator/src/services/mixmining/health_check_runner.rs +++ b/validator/src/services/mixmining/health_check_runner.rs @@ -24,27 +24,25 @@ impl HealthCheckRunner { } pub async fn run(self) { - tokio::spawn(async move { - let healthcheck_interval = Duration::from_secs_f64(self.interval); - debug!("healthcheck will run every {:?}", healthcheck_interval); - loop { - let full_topology = - directory_client::presence::Topology::new(self.directory_server.clone()); - let version_filtered_topology = full_topology.filter_node_versions( - crate::built_info::PKG_VERSION, - crate::built_info::PKG_VERSION, - crate::built_info::PKG_VERSION, - ); - match self - .health_checker - .do_check(&version_filtered_topology) - .await - { - Ok(health) => info!("current network health: \n{}", health), - Err(err) => error!("failed to perform healthcheck - {:?}", err), - }; - tokio::time::delay_for(healthcheck_interval).await; - } - }); + let healthcheck_interval = Duration::from_secs_f64(self.interval); + debug!("healthcheck will run every {:?}", healthcheck_interval); + loop { + let full_topology = + directory_client::presence::Topology::new(self.directory_server.clone()); + let version_filtered_topology = full_topology.filter_node_versions( + crate::built_info::PKG_VERSION, + crate::built_info::PKG_VERSION, + crate::built_info::PKG_VERSION, + ); + match self + .health_checker + .do_check(&version_filtered_topology) + .await + { + Ok(health) => info!("current network health: \n{}", health), + Err(err) => error!("failed to perform healthcheck - {:?}", err), + }; + tokio::time::delay_for(healthcheck_interval).await; + } } }