|
|
@ -10,6 +10,7 @@ defmodule Indexer.ReplacedTransaction.Fetcher do |
|
|
|
alias Explorer.Chain |
|
|
|
alias Explorer.Chain |
|
|
|
alias Explorer.Chain.Hash |
|
|
|
alias Explorer.Chain.Hash |
|
|
|
alias Indexer.{BufferedTask, Tracer} |
|
|
|
alias Indexer.{BufferedTask, Tracer} |
|
|
|
|
|
|
|
alias Indexer.ReplacedTransaction.Supervisor, as: ReplacedTransactionSupervisor |
|
|
|
|
|
|
|
|
|
|
|
@behaviour BufferedTask |
|
|
|
@behaviour BufferedTask |
|
|
|
|
|
|
|
|
|
|
@ -31,10 +32,13 @@ defmodule Indexer.ReplacedTransaction.Fetcher do |
|
|
|
} |
|
|
|
} |
|
|
|
]) :: :ok |
|
|
|
]) :: :ok |
|
|
|
def async_fetch(transactions_fields, timeout \\ 5000) when is_list(transactions_fields) do |
|
|
|
def async_fetch(transactions_fields, timeout \\ 5000) when is_list(transactions_fields) do |
|
|
|
|
|
|
|
if ReplacedTransactionSupervisor.disabled?() do |
|
|
|
|
|
|
|
:ok |
|
|
|
|
|
|
|
else |
|
|
|
entries = Enum.map(transactions_fields, &entry/1) |
|
|
|
entries = Enum.map(transactions_fields, &entry/1) |
|
|
|
|
|
|
|
|
|
|
|
BufferedTask.buffer(__MODULE__, entries, timeout) |
|
|
|
BufferedTask.buffer(__MODULE__, entries, timeout) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@doc false |
|
|
|
@doc false |
|
|
|
def child_spec([init_options, gen_server_options]) do |
|
|
|
def child_spec([init_options, gen_server_options]) do |
|
|
|