mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-29 11:07:54 +00:00
[ty] Fix server hang after shutdown request (#18414)
This commit is contained in:
parent
844c8626c3
commit
1e6d76c878
10 changed files with 176 additions and 158 deletions
|
|
@ -37,10 +37,18 @@ pub fn run_server() -> anyhow::Result<()> {
|
|||
|
||||
let io_result = io_threads.join();
|
||||
|
||||
match (server_result, io_result) {
|
||||
let result = match (server_result, io_result) {
|
||||
(Ok(()), Ok(())) => Ok(()),
|
||||
(Err(server), Err(io)) => Err(server).context(format!("IO thread error: {io}")),
|
||||
(Err(server), _) => Err(server),
|
||||
(_, Err(io)) => Err(io).context("IO thread error"),
|
||||
};
|
||||
|
||||
if let Err(err) = result.as_ref() {
|
||||
tracing::warn!("Server shut down with an error: {err}");
|
||||
} else {
|
||||
tracing::info!("Server shut down");
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue