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