From 19e51ce3289f790e19a1d9e436f3922e6106c851 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 6 Feb 2023 13:48:50 -0800 Subject: [PATCH] check http servers twice as often --- web3_proxy/src/rpcs/many.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web3_proxy/src/rpcs/many.rs b/web3_proxy/src/rpcs/many.rs index c8ab6b0a..c50bab61 100644 --- a/web3_proxy/src/rpcs/many.rs +++ b/web3_proxy/src/rpcs/many.rs @@ -94,7 +94,7 @@ impl Web3Rpcs { drop(receiver); // TODO: what interval? follow a websocket also? maybe by watching synced connections with a timeout. will need debounce - let mut interval = interval(Duration::from_millis(expected_block_time_ms)); + let mut interval = interval(Duration::from_millis(expected_block_time_ms / 2)); interval.set_missed_tick_behavior(MissedTickBehavior::Delay); let sender = Arc::new(sender); @@ -104,10 +104,9 @@ impl Web3Rpcs { async move { loop { - // TODO: every time a head_block arrives (with a small delay for known slow servers), or on the interval. interval.tick().await; - // // trace!("http interval ready"); + // trace!("http interval ready"); // errors are okay. they mean that all receivers have been dropped let _ = sender.send(());