support executing configurable admin commands via SIGUSR2

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-28 21:30:12 +00:00
commit 2c5af902a3
6 changed files with 72 additions and 19 deletions
src/service/config

View file

@ -1,4 +1,4 @@
use std::{iter, path::Path, sync::Arc};
use std::{iter, ops::Deref, path::Path, sync::Arc};
use async_trait::async_trait;
use conduwuit::{
@ -33,6 +33,13 @@ impl crate::Service for Service {
fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
impl Deref for Service {
type Target = Arc<Config>;
#[inline]
fn deref(&self) -> &Self::Target { &self.server.config }
}
#[implement(Service)]
fn handle_reload(&self) -> Result {
if self.server.config.config_reload_signal {