clean up sync log

This commit is contained in:
mbecker20
2024-06-15 19:45:53 -07:00
parent b12cf858d8
commit 7872771aee
2 changed files with 22 additions and 7 deletions
+20 -6
View File
@@ -476,8 +476,7 @@ pub async fn run_updates(
}
let mut has_error = false;
let mut log =
format!("running updates on {}s", Deployment::resource_type());
let mut log = String::new();
// Collect all the deployment names that need to be deployed
// and their 'after' dependencies
@@ -625,17 +624,32 @@ pub async fn run_updates(
}
}
let stage = format!("Update {}s", Deployment::resource_type());
let mut logs = Vec::with_capacity(1);
let stage = format!("Update {}s", Deployment::resource_type());
if has_error {
let log = format!(
"running updates on {}s{log}",
Deployment::resource_type()
);
logs.push(Log::error(&stage, log));
return Some(logs);
} else {
} else if !log.is_empty() {
let log = format!(
"running updates on {}s{log}",
Deployment::resource_type()
);
logs.push(Log::simple(&stage, log));
}
let mut log =
String::from("running executions to sync deployment state...");
if to_deploy.is_empty() {
return Some(logs);
}
let mut log = format!(
"{}: running executions to sync deployment state",
muted("INFO")
);
let mut round = 1;
while !to_deploy.is_empty() {
+2 -1
View File
@@ -9,7 +9,8 @@ pub fn read_resources(
path: &Path,
) -> anyhow::Result<(ResourcesToml, Log)> {
let mut res = ResourcesToml::default();
let mut log = format!("reading resources from {path:?}");
let mut log =
format!("{}: reading resources from {path:?}", muted("INFO"));
read_resources_recursive(path, &mut res, &mut log).with_context(
|| format!("failed to read resources from {path:?}"),
)?;