fix: bug for dynamic reloading of config files

This commit is contained in:
Jun Kurihara 2023-08-09 14:07:40 +09:00
commit 7c2205f275
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
5 changed files with 44 additions and 12 deletions

View file

@ -36,6 +36,7 @@ pub async fn entrypoint<T>(
proxy_config: &ProxyConfig,
app_config_list: &AppConfigList<T>,
runtime_handle: &tokio::runtime::Handle,
term_notify: Option<Arc<tokio::sync::Notify>>,
) -> Result<()>
where
T: CryptoSource + Clone + Send + Sync + 'static,
@ -68,7 +69,7 @@ where
runtime_handle: runtime_handle.clone(),
});
// TODO: HTTP2 only client is needed for http2 cleartext case
// build message handler including a request forwarder
let msg_handler = Arc::new(
HttpMessageHandlerBuilder::default()
.forwarder(Arc::new(Forwarder::new().await))
@ -91,7 +92,7 @@ where
.build()
.unwrap();
globals.runtime_handle.spawn(proxy.start())
globals.runtime_handle.spawn(proxy.start(term_notify.clone()))
}));
// wait for all future