|
|
@ -349,10 +349,14 @@ defmodule Indexer.Block.Catchup.Fetcher do |
|
|
|
def push_front(block_numbers) do |
|
|
|
def push_front(block_numbers) do |
|
|
|
if Process.whereis(@sequence_name) do |
|
|
|
if Process.whereis(@sequence_name) do |
|
|
|
Enum.reduce_while(block_numbers, :ok, fn block_number, :ok -> |
|
|
|
Enum.reduce_while(block_numbers, :ok, fn block_number, :ok -> |
|
|
|
|
|
|
|
if is_integer(block_number) do |
|
|
|
case Sequence.push_front(@sequence_name, block_number..block_number) do |
|
|
|
case Sequence.push_front(@sequence_name, block_number..block_number) do |
|
|
|
:ok -> {:cont, :ok} |
|
|
|
:ok -> {:cont, :ok} |
|
|
|
{:error, _} = error -> {:halt, error} |
|
|
|
{:error, _} = error -> {:halt, error} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
Logger.warn(fn -> ["Received a non-integer block number: ", inspect(block_number)] end) |
|
|
|
|
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
else |
|
|
|
else |
|
|
|
{:error, :queue_unavailable} |
|
|
|
{:error, :queue_unavailable} |
|
|
|