Skip to content

Commit

Permalink
Fix server hang on exit (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgb authored Nov 13, 2024
1 parent d2e1b91 commit 26edd16
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/y-sweet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ async fn main() -> Result<()> {
*port,
);

let server_handle = tokio::spawn(async move {
tokio::spawn(async move {
server.serve_doc(&addr, false).await.unwrap();
});

Expand Down Expand Up @@ -340,7 +340,6 @@ async fn main() -> Result<()> {
}

cancellation_token.cancel();
server_handle.await?;
tracing::info!("Server shut down.");
}
}
Expand Down

0 comments on commit 26edd16

Please sign in to comment.