fix(channel): hot-apply runtime config updates for running channel service

This commit is contained in:
Chummy 2026-02-20 01:51:32 +08:00
parent 95ec5922d1
commit 740eb17d76
7 changed files with 410 additions and 22 deletions

View file

@ -16,6 +16,7 @@ pub fn handle_command(command: &crate::ServiceCommands, config: &Config) -> Resu
crate::ServiceCommands::Install => install(config),
crate::ServiceCommands::Start => start(config),
crate::ServiceCommands::Stop => stop(config),
crate::ServiceCommands::Restart => restart(config),
crate::ServiceCommands::Status => status(config),
crate::ServiceCommands::Uninstall => uninstall(config),
}
@ -84,6 +85,13 @@ fn stop(config: &Config) -> Result<()> {
}
}
fn restart(config: &Config) -> Result<()> {
stop(config)?;
start(config)?;
println!("✅ Service restarted");
Ok(())
}
fn status(config: &Config) -> Result<()> {
if cfg!(target_os = "macos") {
let out = run_capture(Command::new("launchctl").arg("list"))?;