Skip to content

Commit c94f785

Browse files
committed
Put the listener / ret bit back to where it was
1 parent 442336a commit c94f785

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

magic-nix-cache/src/main.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,6 @@ async fn main_cli(args: Args, recorder: detsys_ids_client::Recorder) -> Result<(
484484

485485
let app = app.layer(Extension(state.clone()));
486486

487-
let serve = axum::serve(listener, app.into_make_service()).with_graceful_shutdown(async move {
488-
shutdown_token.cancelled_owned().await;
489-
tracing::info!("Shutting down");
490-
});
491-
492487
let startup_blob = serde_json::json!({
493488
"address": listener_addr
494489
});
@@ -557,10 +552,16 @@ async fn main_cli(args: Args, recorder: detsys_ids_client::Recorder) -> Result<(
557552
tracing::debug!("Created startup notification file at {startup_notification_file_path:?}");
558553
}
559554

555+
let listener = tokio::net::TcpListener::bind(&args.listen).await?;
556+
let ret = axum::serve(listener, app.into_make_service()).with_graceful_shutdown(async move {
557+
shutdown_token.cancelled_owned().await;
558+
tracing::info!("Shutting down");
559+
});
560+
560561
// Notify diagnostics endpoint
561562
state.metrics.send().await;
562563

563-
serve.await?;
564+
ret.await?;
564565

565566
Ok(())
566567
}

0 commit comments

Comments
 (0)