support executing configurable admin commands via SIGUSR2
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
2f449ba47d
commit
2c5af902a3
6 changed files with 72 additions and 19 deletions
src/service/config
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue