From 46ee5bf2777076ca40f801933049bd8b5a2420f7 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 27 Jun 2023 11:02:12 -0700 Subject: [PATCH] that loop waits forever --- web3_proxy/src/stats/stat_buffer.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web3_proxy/src/stats/stat_buffer.rs b/web3_proxy/src/stats/stat_buffer.rs index 4936a44d..55b19500 100644 --- a/web3_proxy/src/stats/stat_buffer.rs +++ b/web3_proxy/src/stats/stat_buffer.rs @@ -162,9 +162,21 @@ impl StatBuffer { } } - // TODO: don't just sleep. wait for things to actually finish + // TODO: wait on all websockets to close + // TODO: wait on all pending external requests to finish sleep(Duration::from_secs(10)).await; + // loop { + // // nope. this won't ever be true because we keep making stats for internal requests + // // if stat_receiver.is_disconnected() { + // // info!("stat_receiver is disconnected"); + // // break; + // // } + + // // TODO: don't just sleep. watch a channel + // sleep(Duration::from_millis(10)).await; + // } + let saved_relational = self.save_relational_stats().await; info!("saved {} pending relational stat(s)", saved_relational);