Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: handover timeout #416

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion standalone/teeworker/handover/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions standalone/teeworker/handover/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"))
Expand Down Expand Up @@ -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()))?;
Expand All @@ -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();
Expand Down
Loading