From bdc69153874a6be825b66a82b1812e676166d00b Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 25 Oct 2022 04:31:18 +0000 Subject: [PATCH] no need for const_new --- web3_proxy/src/frontend/authorization.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/frontend/authorization.rs b/web3_proxy/src/frontend/authorization.rs index 330a8aa2..f1203966 100644 --- a/web3_proxy/src/frontend/authorization.rs +++ b/web3_proxy/src/frontend/authorization.rs @@ -330,7 +330,7 @@ impl Web3ProxyApp { .ip_semaphores .get_with(ip, async move { // TODO: set max_concurrent_requests dynamically based on load? - let s = Semaphore::const_new(max_concurrent_requests); + let s = Semaphore::new(max_concurrent_requests); Arc::new(s) }) .await; @@ -356,7 +356,7 @@ impl Web3ProxyApp { let semaphore = self .user_key_semaphores .try_get_with(user_data.user_key_id, async move { - let s = Semaphore::const_new(max_concurrent_requests.try_into()?); + let s = Semaphore::new(max_concurrent_requests as usize); trace!("new semaphore for user_key_id {}", user_data.user_key_id); Ok::<_, anyhow::Error>(Arc::new(s)) })