add server restart support w/ admin command

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-16 19:46:32 +00:00
parent 2cb31275f0
commit c6f4b20e17
5 changed files with 54 additions and 2 deletions

View file

@ -49,6 +49,10 @@ pub(crate) enum ServerCommand {
/// - Hot-reload the server
Reload,
#[cfg(unix)]
/// - Restart the server
Restart,
/// - Shutdown the server
Shutdown,
}
@ -72,6 +76,8 @@ pub(crate) async fn process(command: ServerCommand, body: Vec<&str>) -> Result<R
} => admin_notice(body, message).await?,
#[cfg(conduit_mods)]
ServerCommand::Reload => reload(body).await?,
#[cfg(unix)]
ServerCommand::Restart => restart(body).await?,
ServerCommand::Shutdown => shutdown(body).await?,
})
}