add faster shutdown point in unix socket listener

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-02 07:31:16 +00:00
parent b1182fe8a4
commit 50cadbee96

View file

@ -106,7 +106,10 @@ async fn accepted(
trace!(?socket, ?handler, "serving connection"); trace!(?socket, ?handler, "serving connection");
// bug on darwin causes all results to be errors. do not unwrap this // bug on darwin causes all results to be errors. do not unwrap this
_ = builder.serve_connection(socket, handler).await; tokio::select! {
() = server.until_shutdown() => (),
_ = builder.serve_connection(socket, handler) => (),
};
} }
async fn init(server: &Arc<Server>) -> Result<UnixListener> { async fn init(server: &Arc<Server>) -> Result<UnixListener> {