From 580f4c1865d2eeba1491b15618dcc174fff5f51a Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 7 Oct 2023 14:26:10 -0700 Subject: [PATCH] lint --- web3_proxy/src/rpcs/request.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web3_proxy/src/rpcs/request.rs b/web3_proxy/src/rpcs/request.rs index ae4e8371..b5150de6 100644 --- a/web3_proxy/src/rpcs/request.rs +++ b/web3_proxy/src/rpcs/request.rs @@ -176,20 +176,19 @@ impl OpenRequestHandle { self.rpc.clone() } - pub fn rate_limit_for(&self, x: Duration) { - // TODO: we actually only want to send if our value is greater - + pub fn rate_limit_for(&self, duration: Duration) { if self.rpc.backup { - debug!(?x, "rate limited on {}!", self.rpc); + debug!(?duration, "rate limited on {}!", self.rpc); } else { - warn!(?x, "rate limited on {}!", self.rpc); + warn!(?duration, "rate limited on {}!", self.rpc); } + // TODO: use send_if_modified to be sure we only send if our value is greater self.rpc .hard_limit_until .as_ref() .unwrap() - .send_replace(Instant::now() + x); + .send_replace(Instant::now() + duration); } /// Just get the response from the provider without any extra handling.