Skip to content

Commit

Permalink
fix(backend): Make registry polling less frequent to improve robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Dec 1, 2022
1 parent 138dc73 commit d86a0a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rs/ic-management-backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down Expand Up @@ -289,6 +289,7 @@ async fn sync_local_store() -> anyhow::Result<()> {
let nns_public_key = nns_public_key(&registry_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);
Expand Down Expand Up @@ -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}");
}
}

Expand Down

0 comments on commit d86a0a2

Please sign in to comment.