From a5cee1fa6211b7fec71cc596bf5ae4e88a38a75b Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Fri, 31 Jan 2020 11:47:20 +0000 Subject: [PATCH] Topology refresh switching to millis interval --- nym-client/src/client/topology_control.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nym-client/src/client/topology_control.rs b/nym-client/src/client/topology_control.rs index 90c84679cc..76c0b1aee7 100644 --- a/nym-client/src/client/topology_control.rs +++ b/nym-client/src/client/topology_control.rs @@ -16,7 +16,7 @@ pub(crate) struct TopologyControl { directory_server: String, inner: Arc>>, health_checker: HealthChecker, - refresh_rate: f64, + refresh_rate: u64, } #[derive(Debug)] @@ -28,7 +28,7 @@ enum TopologyError { impl TopologyControl { pub(crate) async fn new( directory_server: String, - refresh_rate: f64, + refresh_rate: u64, identity_keypair: MixIdentityKeyPair, ) -> Self { // this is a temporary solution as the healthcheck will eventually be moved to validators @@ -99,7 +99,7 @@ impl TopologyControl { pub(crate) async fn run_refresher(mut self) { info!("Starting topology refresher"); - let delay_duration = Duration::from_secs_f64(self.refresh_rate); + let delay_duration = Duration::from_millis(self.refresh_rate); loop { trace!("Refreshing the topology"); let new_topology_res = self.get_current_compatible_topology().await;