mirror of
https://github.com/ParrotXray/Mantis.git
synced 2026-08-24 18:50:28 +09:00
feat: add graceful shutdown on SIGINT
This commit is contained in:
parent
48919b9c58
commit
1b6ac4bcee
@ -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(())
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user