fix realtime fetcher small skips feature

If indexing is started from scratch, realtime fetcher
tries to index large ranges of blocks. For example, 5..1852044.
It produces errors like
`failed to fetch: :emfile.  Block will be retried by catchup indexer`

This PR limits the number of blocks to 10
pull/2843/head
Ayrat Badykov 5 years ago
parent 814a593baa
commit 187f0dc402
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex
  2. 6
      apps/indexer/lib/indexer/block/realtime/fetcher.ex

@ -308,7 +308,7 @@ defmodule EthereumJSONRPC.Transaction do
end
def to_elixir(transaction) when is_binary(transaction) do
Logger.warn(["Fetched transaction is not full: ", transaction])
# Logger.warn(["Fetched transaction is not full: ", transaction])
nil
end

@ -250,7 +250,11 @@ defmodule Indexer.Block.Realtime.Fetcher do
[number]
true ->
(previous_number + 1)..number
if number - previous_number - 1 > 10 do
(number - 10)..number
else
(previous_number + 1)..number
end
end
end

Loading…
Cancel
Save