|
|
@ -16,12 +16,9 @@ defmodule Indexer.Block.Catchup.MissingRangesManipulator do |
|
|
|
GenServer.call(__MODULE__, :get_latest_batch) |
|
|
|
GenServer.call(__MODULE__, :get_latest_batch) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def delete_range(range) do |
|
|
|
@timeout_by_range 2000 |
|
|
|
GenServer.cast(__MODULE__, {:delete_range, range}) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def clear_batch(batch) do |
|
|
|
def clear_batch(batch) do |
|
|
|
GenServer.cast(__MODULE__, {:clear_batch, batch}) |
|
|
|
GenServer.call(__MODULE__, {:clear_batch, batch}, @timeout_by_range * Enum.count(batch)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@impl true |
|
|
|
@impl true |
|
|
@ -42,9 +39,7 @@ defmodule Indexer.Block.Catchup.MissingRangesManipulator do |
|
|
|
{:noreply, state} |
|
|
|
{:noreply, state} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def handle_cast({:clear_batch, batch}, state) do |
|
|
|
def handle_call({:clear_batch, batch}, _from, state) do |
|
|
|
MissingBlockRange.clear_batch(batch) |
|
|
|
{:reply, MissingBlockRange.clear_batch(batch), state} |
|
|
|
|
|
|
|
|
|
|
|
{:noreply, state} |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|