From cec749679448eb60d93ee1d325ca329ff96f37ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Mon, 28 Mar 2022 16:11:18 +0200 Subject: [PATCH] connection-tester: cap number of urls tested async --- common/client-libs/validator-client/src/connection_tester.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/client-libs/validator-client/src/connection_tester.rs b/common/client-libs/validator-client/src/connection_tester.rs index 11d1dd70a4..0e1d51577a 100644 --- a/common/client-libs/validator-client/src/connection_tester.rs +++ b/common/client-libs/validator-client/src/connection_tester.rs @@ -11,6 +11,8 @@ use std::time::Duration; use tokio::time::timeout; use url::Url; +const MAX_URLS_TESTED: usize = 200; + // Run connection tests for all specified nymd and api urls. These are all run concurrently. pub async fn run_validator_connection_test( nymd_urls: impl Iterator, @@ -43,7 +45,7 @@ pub async fn run_validator_connection_test( let connection_results = futures::future::join_all( connection_test_clients .into_iter() - .take(200) + .take(MAX_URLS_TESTED) .map(ClientForConnectionTest::run_connection_check), ) .await;