Skip to content

Commit

Permalink
Merge pull request blockscout#5081 from blockscout/vb-int-txs-fetcher…
Browse files Browse the repository at this point in the history
…-disabled-config

Internal transactions fetcher disabled? config parameter
  • Loading branch information
vbaranov authored and jagdeep sidhu committed Jan 11, 2022
1 parent f920825 commit 69989de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [#5051](https://github.com/blockscout/blockscout/pull/5051) - Fix 500 response when ABI method was parsed as nil

### Chore
- [#5081](https://github.com/blockscout/blockscout/pull/5081) - Add internal transactions fetcher disabled? config parameter
- [#5063](https://github.com/blockscout/blockscout/pull/5063) - Resolve moderate NPM vulnerabilities with npm audit tool
- [#5053](https://github.com/blockscout/blockscout/pull/5053) - Update ex_keccak lib

Expand Down
4 changes: 4 additions & 0 deletions apps/indexer/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ config :indexer, Indexer.Fetcher.TokenBalanceOnDemand, threshold: token_balance_
# config :indexer, Indexer.Fetcher.ReplacedTransaction.Supervisor, disabled?: true
if System.get_env("POS_STAKING_CONTRACT") do
config :indexer, Indexer.Fetcher.BlockReward.Supervisor, disabled?: true
else
config :indexer, Indexer.Fetcher.BlockReward.Supervisor, disabled?: false
end

config :indexer, Indexer.Fetcher.InternalTransaction.Supervisor, disabled?: false

config :indexer, Indexer.Supervisor, enabled: System.get_env("DISABLE_INDEXER") != "true"

config :indexer, Indexer.Tracer,
Expand Down
7 changes: 6 additions & 1 deletion apps/indexer/lib/indexer/fetcher/internal_transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ defmodule Indexer.Fetcher.InternalTransaction do
alias Explorer.Chain.Block
alias Explorer.Chain.Cache.{Accounts, Blocks}
alias Indexer.{BufferedTask, Tracer}
alias Indexer.Fetcher.InternalTransaction.Supervisor, as: InternalTransactionSupervisor
alias Indexer.Transform.Addresses

@behaviour BufferedTask
Expand Down Expand Up @@ -49,7 +50,11 @@ defmodule Indexer.Fetcher.InternalTransaction do
"""
@spec async_fetch([Block.block_number()]) :: :ok
def async_fetch(block_numbers, timeout \\ 5000) when is_list(block_numbers) do
BufferedTask.buffer(__MODULE__, block_numbers, timeout)
if InternalTransactionSupervisor.disabled?() do
:ok
else
BufferedTask.buffer(__MODULE__, block_numbers, timeout)
end
end

@doc false
Expand Down

0 comments on commit 69989de

Please sign in to comment.