From 4a4bcb4febeebc556a33fb0c5ab8d847c6d2724f Mon Sep 17 00:00:00 2001 From: ardocrat Date: Thu, 16 May 2024 21:52:46 +0300 Subject: [PATCH] tor: increase service check delay --- src/tor/tor.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/tor/tor.rs b/src/tor/tor.rs index 687cb24..984f934 100644 --- a/src/tor/tor.rs +++ b/src/tor/tor.rs @@ -288,12 +288,12 @@ impl Tor { // Remove service from starting. let mut w_services = TOR_SERVER_STATE.starting_services.write(); w_services.remove(&service_id); - // Check again after 5 seconds. - Duration::from_millis(5000) + // Check again after 10 seconds. + Duration::from_millis(10000) }, Err(_) => { // Restart service on 3rd error. - let duration = if errors_count == MAX_ERRORS - 1 { + if errors_count == MAX_ERRORS - 1 { errors_count = 0; let key = key.clone(); let service_id = service_id.clone(); @@ -305,12 +305,10 @@ impl Tor { *w_client = client_config; Self::start_service(port, key, &service_id); }); - Duration::from_millis(5000) } else { errors_count += 1; - Duration::from_millis(1000) - }; - duration + } + Duration::from_millis(5000) }, }; sleep(duration).await;