|
|
|
@ -262,6 +262,19 @@ defmodule Indexer.Block.Catchup.BoundIntervalSupervisor do |
|
|
|
|
{:noreply, %__MODULE__{state | task: nil}} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def handle_info( |
|
|
|
|
{ref, {:error, :etimedout}}, |
|
|
|
|
%__MODULE__{ |
|
|
|
|
task: %Task{ref: ref} |
|
|
|
|
} = state |
|
|
|
|
) do |
|
|
|
|
Logger.info("Index had to catch up, but the but request is timing out, so retrying immediately.") |
|
|
|
|
|
|
|
|
|
send(self(), :catchup_index) |
|
|
|
|
|
|
|
|
|
{:noreply, %__MODULE__{state | task: nil}} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def handle_info( |
|
|
|
|
{:DOWN, ref, :process, pid, reason}, |
|
|
|
|
%__MODULE__{task: %Task{pid: pid, ref: ref}} = state |
|
|
|
@ -272,4 +285,15 @@ defmodule Indexer.Block.Catchup.BoundIntervalSupervisor do |
|
|
|
|
|
|
|
|
|
{:noreply, %__MODULE__{state | task: nil}} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def handle_info( |
|
|
|
|
{:DOWN, _ref, :process, _pid, reason}, |
|
|
|
|
%__MODULE__{task: nil} = state |
|
|
|
|
) do |
|
|
|
|
Logger.error(fn -> "Catchup index stream exited with reason (#{inspect(reason)}). Restarting" end) |
|
|
|
|
|
|
|
|
|
send(self(), :catchup_index) |
|
|
|
|
|
|
|
|
|
{:noreply, %__MODULE__{state | task: nil}} |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|