diff --git a/block-streamer/src/block_stream.rs b/block-streamer/src/block_stream.rs index 1a1eab71..04cd824a 100644 --- a/block-streamer/src/block_stream.rs +++ b/block-streamer/src/block_stream.rs @@ -269,15 +269,26 @@ async fn process_bitmap_indexer_blocks( let mut last_published_block_height: u64 = start_block_height; - while let Some(Ok(block_height)) = matching_block_heights.next().await { - redis - .publish_block(indexer, redis_stream.clone(), block_height, MAX_STREAM_SIZE) - .await?; - redis - .set_last_processed_block(indexer, block_height) - .await?; - - last_published_block_height = block_height; + while let Some(block_height_result) = matching_block_heights.next().await { + match block_height_result { + Ok(block_height) => { + redis + .publish_block(indexer, redis_stream.clone(), block_height, MAX_STREAM_SIZE) + .await?; + redis + .set_last_processed_block(indexer, block_height) + .await?; + + last_published_block_height = block_height; + } + Err(err) => { + tracing::error!( + "Backfill using bitmap indexer failed unexpectedly: {:?}", + err + ); + break; + } + } } Ok(last_published_block_height)