From 95140ed3ae99d4e9257de000f67a963ca0f892a9 Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Thu, 18 Apr 2024 08:09:43 +0200 Subject: [PATCH] improve connection response --- base_layer/wallet/src/connectivity_service/service.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base_layer/wallet/src/connectivity_service/service.rs b/base_layer/wallet/src/connectivity_service/service.rs index f7e380113f..bb845a53f9 100644 --- a/base_layer/wallet/src/connectivity_service/service.rs +++ b/base_layer/wallet/src/connectivity_service/service.rs @@ -43,6 +43,7 @@ use crate::{ }; const LOG_TARGET: &str = "wallet::connectivity"; +const CONNECTIVITY_WAIT: u64 = 5; /// Connection status of the Base Node #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -270,7 +271,7 @@ impl WalletConnectivityService { self.config.base_node_monitor_max_refresh_interval.as_secs() ); self.set_online_status(OnlineStatus::Offline); - time::sleep(self.config.base_node_monitor_max_refresh_interval).await; + time::sleep(Duration::from_secs(CONNECTIVITY_WAIT)).await; continue; }, Err(e) => { @@ -278,7 +279,7 @@ impl WalletConnectivityService { if self.current_base_node().as_ref() == Some(&node_id) { self.disconnect_base_node(node_id).await; self.set_online_status(OnlineStatus::Offline); - time::sleep(self.config.base_node_monitor_max_refresh_interval).await; + time::sleep(Duration::from_secs(CONNECTIVITY_WAIT)).await; } continue; },