From ded84c963387bd42810bcf37ab139759fd04d9ab Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Mon, 16 Jul 2018 10:26:46 -0500 Subject: [PATCH] Cap genesis sequence immediately Genesis sequence should only fetch the missing ranges --- apps/indexer/lib/indexer/block_fetcher.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/indexer/lib/indexer/block_fetcher.ex b/apps/indexer/lib/indexer/block_fetcher.ex index db5dfaa188..1073236389 100644 --- a/apps/indexer/lib/indexer/block_fetcher.ex +++ b/apps/indexer/lib/indexer/block_fetcher.ex @@ -188,8 +188,8 @@ defmodule Indexer.BlockFetcher do debug(fn -> "#{count} missed block ranges between #{latest_block_number} and genesis" end) - {:ok, seq} = - Sequence.start_link(prefix: missing_ranges, first: 0, step: -1 * state.blocks_batch_size) + {:ok, seq} = Sequence.start_link(prefix: missing_ranges, first: 0, step: -1 * state.blocks_batch_size) + Sequence.cap(seq) stream_import(state, seq, max_concurrency: state.blocks_concurrency) end