Skip to content

Commit

Permalink
fix workload shieldsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman committed Nov 22, 2024
1 parent 88f35ca commit 012a715
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions workload/src/build_checks/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ pub async fn shield_sync(sdk: &Sdk) -> Result<(), StepError> {
.await
.map_err(|e| StepError::ShieldedSync(e.to_string()))?;

shielded_ctx.save().await.map_err(|e| StepError::ShieldedSync(e.to_string()))?;

tracing::info!("Done shieldsync (took {}s)!", now.elapsed().as_secs());

Ok(())
Expand Down
9 changes: 7 additions & 2 deletions workload/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ async fn inner_main() -> i32 {

// Setup shielded context storage
let shielded_ctx_path = state.base_dir.join(format!("masp-{}", config.id));
let shielded_ctx = ShieldedContext::new(FsShieldedUtils::new(shielded_ctx_path));
shielded_ctx.save().await.unwrap();

let mut shielded_ctx = ShieldedContext::new(FsShieldedUtils::new(shielded_ctx_path.clone()));
if shielded_ctx_path.join("shielded.dat").exists() {
shielded_ctx.load().await.expect("Should be able to load shielded context");
} else {
shielded_ctx.save().await.unwrap();
}

let io = NullIo;

Expand Down

0 comments on commit 012a715

Please sign in to comment.