From 57fc8160ca0f4ab20dbdd85a20d0f781383bc969 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 13 May 2022 17:42:54 +0000 Subject: [PATCH] Revert "try no cache?" This reverts commit ff09ec73a44fc07304d02968d5e09eb3719dab9e. --- web3-proxy/src/app.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web3-proxy/src/app.rs b/web3-proxy/src/app.rs index bc864900..09fbc730 100644 --- a/web3-proxy/src/app.rs +++ b/web3-proxy/src/app.rs @@ -261,7 +261,6 @@ impl Web3ProxyApp { continue; } - /* // TODO: building this cache key is slow and its large, but i don't see a better way right now // TODO: inspect the params and see if a block is specified. if so, use that block number instead of current_block // TODO: move this to a helper function. have it be a lot smarter @@ -277,7 +276,6 @@ impl Web3ProxyApp { // TODO: return a reference in the other places so that this works without a clone? return Ok(cached.to_owned()); } - */ // TODO: what allowed lag? match balanced_rpcs.next_upstream_server().await { @@ -299,7 +297,6 @@ impl Web3ProxyApp { error: None, }; - /* // TODO: small race condidition here. parallel requests with the same query will both be saved to the cache // TODO: try_write is unlikely to get the lock. i think instead we should spawn another task for caching if let Ok(mut response_cache) = self.response_cache.try_write() @@ -311,7 +308,6 @@ impl Web3ProxyApp { response_cache.pop_front(); } } - */ response }