From 7ff319e9b01baac2c411de12c8e3024fd2ca1a3e Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 12 Sep 2022 14:33:19 +0000 Subject: [PATCH] reconnect sooner --- TODO.md | 1 + web3_proxy/src/rpcs/connection.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 09f773e4..74d951f4 100644 --- a/TODO.md +++ b/TODO.md @@ -192,6 +192,7 @@ These are not yet ordered. - [ ] don't "unwrap" anywhere. give proper errors - [ ] handle log subscriptions - probably as a paid feature +- [ ] exponential backoff when reconnecting a connection new endpoints for users (not totally sure about the exact paths, but these features are all needed): - [x] GET /u/:api_key diff --git a/web3_proxy/src/rpcs/connection.rs b/web3_proxy/src/rpcs/connection.rs index b900207c..2e7f224c 100644 --- a/web3_proxy/src/rpcs/connection.rs +++ b/web3_proxy/src/rpcs/connection.rs @@ -447,7 +447,7 @@ impl Web3Connection { Err(err) => { if reconnect { // TODO: exponential backoff - let retry_in = Duration::from_secs(1); + let retry_in = Duration::from_millis(50); warn!( rpc=%self, ?err,