From 4268bd6037b4c2ee7e04dad2be83c313476c0740 Mon Sep 17 00:00:00 2001 From: EAimTY Date: Sun, 3 Jul 2022 17:18:31 +0900 Subject: [PATCH] throttle down client re-connect retries --- client/src/relay/connection.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/relay/connection.rs b/client/src/relay/connection.rs index 850405b..91fcbb6 100644 --- a/client/src/relay/connection.rs +++ b/client/src/relay/connection.rs @@ -51,6 +51,10 @@ pub async fn manage_connection( Ok(conn) => conn, Err(err) => { log::error!("[relay] [connection] {err}"); + + // sleep 1 second to avoid drawing too much CPU + time::sleep(Duration::from_secs(1)).await; + continue; } };