support admin server restart --force

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-03 04:46:50 +00:00
parent 7658387a74
commit 5edd391e83
4 changed files with 62 additions and 6 deletions

View file

@ -51,7 +51,10 @@ pub(super) enum ServerCommand {
#[cfg(unix)]
/// - Restart the server
Restart,
Restart {
#[arg(short, long)]
force: bool,
},
/// - Shutdown the server
Shutdown,
@ -77,7 +80,9 @@ pub(super) async fn process(command: ServerCommand, body: Vec<&str>) -> Result<R
#[cfg(conduit_mods)]
ServerCommand::Reload => reload(body).await?,
#[cfg(unix)]
ServerCommand::Restart => restart(body).await?,
ServerCommand::Restart {
force,
} => restart(body, force).await?,
ServerCommand::Shutdown => shutdown(body).await?,
})
}