From 3834032d8e7b6550e63244886224106143ef65e3 Mon Sep 17 00:00:00 2001 From: imabdulbasit Date: Wed, 18 Oct 2023 22:53:17 +0500 Subject: [PATCH] adjust retries for compression nonce --- consumer/src/solana.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/consumer/src/solana.rs b/consumer/src/solana.rs index 768085c..8479946 100644 --- a/consumer/src/solana.rs +++ b/consumer/src/solana.rs @@ -215,10 +215,21 @@ impl Solana { &self, signature: &Signature, ) -> Result { - let response = with_retry!( + let response = (|| async { self.rpc() .get_transaction(signature, UiTransactionEncoding::Json) + .await + }) + .retry( + &ExponentialBuilder::default() + .with_jitter() + .with_min_delay(Duration::from_millis(300)) + .with_max_delay(Duration::from_secs(2)) + .with_max_times(25), ) + .notify(|err: &ClientError, dur: Duration| { + error!("retrying error {:?} in {:?}", err, dur); + }) .await?; let meta = response