err handling conpool start

This commit is contained in:
mfahampshire
2024-11-27 14:06:26 +01:00
parent 8fcea5f350
commit 4bb05f3698
@@ -73,8 +73,12 @@ impl NymProxyClient {
TcpListener::bind(format!("{}:{}", self.listen_address, self.listen_port)).await?;
let client_maker = self.conn_pool.clone();
tokio::spawn(async move { client_maker.start().await.unwrap() });
tokio::spawn(async move {
client_maker.start().await?;
Ok::<(), anyhow::Error>(())
});
// TODO add 'ready' marker for consuming code
loop {
if DEFAULT_CLIENT_POOL_SIZE == 1 && self.conn_pool.get_client_count().await == 1
|| self.conn_pool.get_client_count().await >= DEFAULT_CLIENT_POOL_SIZE / 2