From 207ea52b95c59c30304f8991d04b4a565d7db9a2 Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Sat, 15 Jun 2024 17:12:02 -0700 Subject: [PATCH] add finished log --- bin/core/src/helpers/sync/deployment.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/core/src/helpers/sync/deployment.rs b/bin/core/src/helpers/sync/deployment.rs index a5520baa8..df5d4f70d 100644 --- a/bin/core/src/helpers/sync/deployment.rs +++ b/bin/core/src/helpers/sync/deployment.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use std::{collections::HashMap, time::Duration}; use anyhow::Context; use futures::future::join_all; @@ -621,10 +621,22 @@ pub async fn run_updates( // Remove the deployed ones from 'to_deploy' to_deploy.retain(|(name, _)| !good_to_deploy.contains(name)); - // Increment the round - round += 1; + // If there must be another round, these are dependent on the first round. + // Sleep for 1s to allow for first round to startup + if !to_deploy.is_empty() { + // Increment the round + round += 1; + tokio::time::sleep(Duration::from_secs(1)).await; + } } + log.push_str(&format!( + "{}: finished after {} round{}", + muted("INFO"), + bold(round), + (round > 1).then_some("s").unwrap_or_default() + )); + Some(logs) }