|
|
|
@ -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, |
|
|
|
|