Skip to content

Commit

Permalink
Merge pull request #90 from holaplex/abdul/nonce-retries
Browse files Browse the repository at this point in the history
Adjust nonce retries
  • Loading branch information
imabdulbasit committed Oct 18, 2023
2 parents 8d54164 + 3834032 commit 11e0e1e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion consumer/src/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,21 @@ impl Solana {
&self,
signature: &Signature,
) -> Result<u32, SolanaAssetIdError> {
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
Expand Down

0 comments on commit 11e0e1e

Please sign in to comment.