Add env to disable indexer supervisor

pull/2376/head
saneery 5 years ago
parent 3bda173b6e
commit 1e4de6e41e
  1. 2
      apps/indexer/config/config.exs
  2. 12
      apps/indexer/lib/indexer/application.ex

@ -41,6 +41,8 @@ config :indexer,
# config :indexer, Indexer.Fetcher.BlockReward.Supervisor, disabled?: true
config :indexer, Indexer.Fetcher.StakingPools.Supervisor, disabled?: true
config :indexer, Indexer.Supervisor, enabled: System.get_env("DISABLE_INDEXER") != "true"
config :indexer, Indexer.Tracer,
service: :indexer,
adapter: SpandexDatadog.Adapter,

@ -17,11 +17,17 @@ defmodule Indexer.Application do
memory_monitor_name = Memory.Monitor
children = [
{Memory.Monitor, [memory_monitor_options, [name: memory_monitor_name]]},
{Indexer.Supervisor, [%{memory_monitor: memory_monitor_name}]}
base_children = [
{Memory.Monitor, [memory_monitor_options, [name: memory_monitor_name]]}
]
children =
if Application.get_env(:indexer, Indexer.Supervisor)[:enabled] do
Enum.reverse([{Indexer.Supervisor, [%{memory_monitor: memory_monitor_name}]} | base_children])
else
base_children
end
opts = [
# If the `Memory.Monitor` dies, it needs all the `Shrinkable`s to re-register, so restart them.
strategy: :rest_for_one,

Loading…
Cancel
Save