File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments