wip: fixing dynamic reloading

This commit is contained in:
Jun Kurihara 2024-07-26 23:25:40 +09:00
commit 8d9f07a848
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
3 changed files with 44 additions and 32 deletions

View file

@ -44,18 +44,20 @@ fn main() {
.unwrap();
tokio::select! {
Err(e) = config_service.start() => {
error!("config reloader service exited: {e}");
std::process::exit(1);
config_res = config_service.start() => {
if let Err(e) = config_res {
error!("config reloader service exited: {e}");
std::process::exit(1);
}
}
Err(e) = rpxy_service_with_watcher(config_rx, runtime.handle().clone()) => {
error!("rpxy service existed: {e}");
std::process::exit(1);
}
else => {
std::process::exit(0);
rpxy_res = rpxy_service_with_watcher(config_rx, runtime.handle().clone()) => {
if let Err(e) = rpxy_res {
error!("rpxy service existed: {e}");
std::process::exit(1);
}
}
}
std::process::exit(0);
}
});
}