Skip to content

Commit

Permalink
shutdown: wait for flakehub_cache first
Browse files Browse the repository at this point in the history
  • Loading branch information
colemickens committed Nov 5, 2024
1 parent 6a5abbf commit 799a0c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions magic-nix-cache/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ async fn workflow_finish(
gha_cache.shutdown().await?;
}

if let Some(attic_state) = state.flakehub_state.write().await.take() {
tracing::info!("Waiting for FlakeHub cache uploads to finish");
let _paths = attic_state.push_session.wait().await?;
}

if let Some(sender) = state.shutdown_sender.lock().await.take() {
sender
.send(())
.map_err(|_| Error::Internal("Sending shutdown server message".to_owned()))?;
}

if let Some(attic_state) = state.flakehub_state.write().await.take() {
tracing::info!("Waiting for FlakeHub cache uploads to finish");
let _paths = attic_state.push_session.wait().await?;
}

// NOTE(cole-h): see `init_logging`
if let Some(logfile) = &state.logfile {
let logfile_contents = std::fs::read_to_string(logfile)
Expand Down

0 comments on commit 799a0c4

Please sign in to comment.