feat: add graceful shutdown on SIGINT

This commit is contained in:
ParrotXray 2026-05-23 03:22:05 +00:00
parent 48919b9c58
commit 1b6ac4bcee

View File

@ -169,6 +169,9 @@ impl System {
.map_err(HttpError::BindPortError)?;
axum::serve(listener, app)
.with_graceful_shutdown(async {
tokio::signal::ctrl_c().await.ok();
})
.await
.map_err(HttpError::ServerPanic)?;
@ -240,4 +243,4 @@ impl System {
}
Ok(())
}
}
}