finally fixed 772644f (2/2) completely

This commit is contained in:
17ms 2023-05-06 03:39:36 +03:00
parent 160cd01a56
commit 63de6d49cc

View File

@ -183,12 +183,12 @@ impl Connector {
metadata: &HashMap<String, (u64, String)>, metadata: &HashMap<String, (u64, String)>,
) -> Result<(), Box<dyn Error + Send + Sync>> { ) -> Result<(), Box<dyn Error + Send + Sync>> {
loop { loop {
let rx_msg = rx.recv().await; let msg = rx.recv().await;
if rx_msg.is_none() { if msg.is_none() {
continue; continue;
} }
match self.msg_handler(rx_msg.unwrap(), conn, metadata).await { match self.msg_handler(msg.unwrap(), conn, metadata).await {
Ok(true) => continue, Ok(true) => continue,
Ok(false) => break, Ok(false) => break,
Err(e) => return Err(e), Err(e) => return Err(e),
@ -206,10 +206,7 @@ impl Connector {
) -> Result<bool, Box<dyn Error + Send + Sync>> { ) -> Result<bool, Box<dyn Error + Send + Sync>> {
match msg { match msg {
Message::ClientReq(name) => { Message::ClientReq(name) => {
let req = match Request::new(name, metadata) { let req = Request::new(name, metadata).unwrap();
Some(req) => req,
None => return Ok(true),
};
self.request(conn, req).await?; self.request(conn, req).await?;
Ok(true) Ok(true)