From 153a54eafd9cde0ae32f1ab68f1f368c88efccc6 Mon Sep 17 00:00:00 2001 From: pmantica11 <151664502+pmantica11@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:10:10 -0600 Subject: [PATCH] Adjust timeout (#227) --- src/ingester/fetchers/poller.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ingester/fetchers/poller.rs b/src/ingester/fetchers/poller.rs index 421abdd..3eea403 100644 --- a/src/ingester/fetchers/poller.rs +++ b/src/ingester/fetchers/poller.rs @@ -2,10 +2,7 @@ use std::{ cmp::max, collections::{BTreeMap, HashSet}, num::NonZeroUsize, - sync::{ - atomic::Ordering, - Arc, - }, + sync::{atomic::Ordering, Arc}, time::Duration, }; @@ -32,7 +29,6 @@ const SKIPPED_BLOCK_ERRORS: [i64; 2] = [-32007, -32009]; const RETRIES: u64 = 3; const INFINITY: u64 = u64::MAX; - /// This function creates a stream that continuously fetches and emits blocks from a Solana blockchain. /// It implements a concurrent block fetching algorithm with the following key features: /// @@ -207,7 +203,7 @@ pub async fn fetch_block( ) -> (Result, client_error::ClientError>, u64) { let mut attempt_counter = 0; loop { - let timeout_sec = 5; + let timeout_sec = if attempt_counter <= 1 { 5 } else { 20 }; let client = RpcClient::new_with_timeout_and_commitment( rpc_uri.clone(), Duration::from_secs(timeout_sec),