diff --git a/stub/src/main.rs b/stub/src/main.rs index 86e387b..8bb836f 100644 --- a/stub/src/main.rs +++ b/stub/src/main.rs @@ -117,20 +117,23 @@ fn main() -> Result<(), Box> { }); tokio::select! { - _ = shutdown_rx.recv() => { tokio::time::sleep(tokio::time::Duration::from_millis(50)).await; + _ = shutdown_rx.recv() => { + tokio::time::sleep(tokio::time::Duration::from_millis(50)).await; tracing::info!("Shutdown received while connected"); - + break; } _ = &mut send_task => { tracing::error!("Send task exited"); - tokio::time::sleep(tokio::time::Duration::from_millis(50)).await; recv_task.abort(); + tokio::time::sleep(tokio::time::Duration::from_millis(50)).await; + recv_task.abort(); + break; } _ = &mut recv_task => { tracing::error!("Recv task exited"); send_task.abort(); } } - tokio::time::sleep(tokio::time::Duration::from_millis(50)).await; + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; } Err(e) => { tracing::error!("Failed to connect via WSS: {}", e);