From 4897c1b294402c3ddb1abbdc9cbfea6421cd8e2a Mon Sep 17 00:00:00 2001 From: "Bill.W" <0xbillw@gmail.com> Date: Fri, 22 Nov 2024 05:43:15 +0000 Subject: [PATCH] hotfix: `handover` timeout --- Cargo.lock | 2 +- standalone/teeworker/handover/Cargo.toml | 2 +- standalone/teeworker/handover/src/main.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be1f8309..552431e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6050,7 +6050,7 @@ dependencies = [ [[package]] name = "handover" -version = "0.1.0" +version = "0.1.1" dependencies = [ "clap", "tokio", diff --git a/standalone/teeworker/handover/Cargo.toml b/standalone/teeworker/handover/Cargo.toml index d020eec4..61e0587d 100644 --- a/standalone/teeworker/handover/Cargo.toml +++ b/standalone/teeworker/handover/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "handover" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/standalone/teeworker/handover/src/main.rs b/standalone/teeworker/handover/src/main.rs index 97a089e0..aa510260 100644 --- a/standalone/teeworker/handover/src/main.rs +++ b/standalone/teeworker/handover/src/main.rs @@ -77,7 +77,7 @@ async fn main() { }; let previous_ceseal_path = Path::new(&args.previous_version_ceseal_path).join(previous_version.to_string()); - log(format!("Previous ${previous_version}")); + log(format!("Previous {previous_version}")); if let Err(err) = tokio::fs::remove_file(&args.previous_ceseal_log_path).await { log(format!("remove old ceseal log file fail : {err}")) @@ -195,7 +195,7 @@ pub async fn redirect_ceseal_runtime_log(stdout: ChildStdout, log_path: String) pub async fn wait_for_ceseal_to_run_successfully(log_path: String, flag: &str) -> Result<(), Error> { let sleep_for_ceseal_running = tokio::time::Duration::from_secs(5); - let mut sleep_times = 3; + let mut sleep_times = 60; //TODO! To extract the hard code into configured parameters let log_file = tokio::fs::File::open(&log_path) .await .map_err(|e| Error::DetectCesealRunningStatueFailed(e.to_string()))?; @@ -207,6 +207,7 @@ pub async fn wait_for_ceseal_to_run_successfully(log_path: String, flag: &str) - log(format!("{}:{}", &log_path, line)); if line.contains(flag) { + log(format!("remain sleep time: {sleep_times}")); return Ok(()) } line.clear();