From d86a0a274c3cbe713080ab878298efa7a60c9aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C5=A1a=20Tomi=C4=87?= Date: Thu, 1 Dec 2022 10:34:13 +0100 Subject: [PATCH] fix(backend): Make registry polling less frequent to improve robustness --- rs/ic-management-backend/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rs/ic-management-backend/src/main.rs b/rs/ic-management-backend/src/main.rs index 1faccad8..e07da898 100644 --- a/rs/ic-management-backend/src/main.rs +++ b/rs/ic-management-backend/src/main.rs @@ -76,7 +76,7 @@ async fn main() -> std::io::Result<()> { if let Err(e) = sync_local_store().await { error!("Failed to update local registry: {}", e); } - std::thread::sleep(std::time::Duration::from_secs(1)); + tokio::time::sleep(std::time::Duration::from_secs(5)).await; print_counter += 1; } }); @@ -289,6 +289,7 @@ async fn sync_local_store() -> anyhow::Result<()> { let nns_public_key = nns_public_key(®istry_canister).await?; loop { + tokio::time::sleep(std::time::Duration::from_secs(2)).await; if match registry_canister.get_latest_version().await { Ok(v) => { info!("Latest registry version: {}", v); @@ -373,7 +374,7 @@ async fn sync_local_store() -> anyhow::Result<()> { latest_version = latest_version.add(RegistryVersion::new(versions_count as u64)); latest_certified_time = t.as_nanos_since_unix_epoch(); - info!("Initial sync reached version {latest_version}"); + debug!("Sync reached version {latest_version}"); } }