Skip to content

Commit

Permalink
firehose: Add timeout to stream_blocks request (graphprotocol#3877)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoyvens authored and Kai Wetlesen committed Sep 7, 2022
1 parent e679c5e commit 49b06f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graph/src/blockchain/firehose_block_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ fn stream_blocks<C: Blockchain, F: FirehoseMapper<C>>(
}

let mut connect_start = Instant::now();
let result = endpoint.clone().stream_blocks(request).await;
let req = endpoint.clone().stream_blocks(request);
let result = tokio::time::timeout(Duration::from_secs(30), req).await.map_err(|x| x.into()).and_then(|x| x);

match result {
Ok(stream) => {
Expand Down

0 comments on commit 49b06f7

Please sign in to comment.