From 2d3cd4d50ec7aad00d1db0b2ff4762493f43adc0 Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Sun, 2 Jun 2024 08:52:28 +0300 Subject: [PATCH] fixup! feat: reconnect after a connection is lost --- yazi-dds/src/client.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/yazi-dds/src/client.rs b/yazi-dds/src/client.rs index fc4517b1..4846b88a 100644 --- a/yazi-dds/src/client.rs +++ b/yazi-dds/src/client.rs @@ -69,14 +69,10 @@ impl Client { /// If a server is closed, attempt to reconnect forever. pub async fn echo_events_to_stdout(kinds: HashSet) -> Result<()> { let mut lines = Self::connect_listener(&kinds).await?; - let mut msg_counter = 0; loop { - println!("Waiting for messages..."); match lines.next_line().await { Ok(Some(s)) => { - println!("Received: message {} '{}'", msg_counter, s); - msg_counter += 1; let kind = s.split(',').next(); if matches!(kind, Some(kind) if kinds.contains(kind)) { println!("{}", s); @@ -87,11 +83,9 @@ impl Client { match Self::connect_listener(&kinds).await { Ok(new_lines) => { lines = new_lines; - println!("Reconnected"); break; } Err(_) => { - println!("Reconnecting..."); time::sleep(time::Duration::from_secs(1)).await; } };