Skip to content

Commit

Permalink
Adjust timeout (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmantica11 authored Oct 16, 2024
1 parent 2bf5e1c commit 153a54e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ingester/fetchers/poller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use std::{
cmp::max,
collections::{BTreeMap, HashSet},
num::NonZeroUsize,
sync::{
atomic::Ordering,
Arc,
},
sync::{atomic::Ordering, Arc},
time::Duration,
};

Expand All @@ -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:
///
Expand Down Expand Up @@ -207,7 +203,7 @@ pub async fn fetch_block(
) -> (Result<Option<BlockInfo>, 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),
Expand Down

0 comments on commit 153a54e

Please sign in to comment.