|
|
@ -18,6 +18,7 @@ defmodule Indexer.Block.Reward.Fetcher do |
|
|
|
alias Explorer.Chain.{Block, Wei} |
|
|
|
alias Explorer.Chain.{Block, Wei} |
|
|
|
alias Indexer.Address.CoinBalances |
|
|
|
alias Indexer.Address.CoinBalances |
|
|
|
alias Indexer.{AddressExtraction, BufferedTask, CoinBalance, Tracer} |
|
|
|
alias Indexer.{AddressExtraction, BufferedTask, CoinBalance, Tracer} |
|
|
|
|
|
|
|
alias Indexer.Block.Reward.Supervisor, as: BlockRewardSupervisor |
|
|
|
|
|
|
|
|
|
|
|
@behaviour BufferedTask |
|
|
|
@behaviour BufferedTask |
|
|
|
|
|
|
|
|
|
|
@ -34,8 +35,12 @@ defmodule Indexer.Block.Reward.Fetcher do |
|
|
|
""" |
|
|
|
""" |
|
|
|
@spec async_fetch([Block.block_number()]) :: :ok |
|
|
|
@spec async_fetch([Block.block_number()]) :: :ok |
|
|
|
def async_fetch(block_numbers) when is_list(block_numbers) do |
|
|
|
def async_fetch(block_numbers) when is_list(block_numbers) do |
|
|
|
|
|
|
|
if BlockRewardSupervisor.disabled?() do |
|
|
|
|
|
|
|
:ok |
|
|
|
|
|
|
|
else |
|
|
|
BufferedTask.buffer(__MODULE__, block_numbers) |
|
|
|
BufferedTask.buffer(__MODULE__, block_numbers) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@doc false |
|
|
|
@doc false |
|
|
|
# credo:disable-for-next-line Credo.Check.Design.DuplicatedCode |
|
|
|
# credo:disable-for-next-line Credo.Check.Design.DuplicatedCode |
|
|
|