Use Explorer.Indexer.Supervisor directly

pull/162/head
Luke Imhoff 7 years ago
parent fbfd510004
commit 5fee144300
  1. 2
      apps/explorer/lib/explorer/application.ex
  2. 24
      apps/explorer/lib/explorer/indexer.ex
  3. 2
      apps/explorer/lib/explorer/indexer/supervisor.ex

@ -27,7 +27,7 @@ defmodule Explorer.Application do
[ [
Explorer.JSONRPC, Explorer.JSONRPC,
Supervisor.child_spec({Task.Supervisor, name: Explorer.TaskSupervisor}, id: Explorer.TaskSupervisor), Supervisor.child_spec({Task.Supervisor, name: Explorer.TaskSupervisor}, id: Explorer.TaskSupervisor),
Explorer.Indexer, Explorer.Indexer.Supervisor,
Explorer.Chain.Statistics.Server, Explorer.Chain.Statistics.Server,
Explorer.ExchangeRates, Explorer.ExchangeRates,
Explorer.Market.History.Cataloger Explorer.Market.History.Cataloger

@ -5,30 +5,6 @@ defmodule Explorer.Indexer do
alias Explorer.Chain alias Explorer.Chain
@doc """
Options passed to `child_spec` are passed to `Explorer.Indexer.Supervisor.start_link/1`
iex> Explorer.Indexer.child_spec([option: :value])
%{
id: Explorer.Indexer,
restart: :permanent,
shutdown: 5000,
start: {Explorer.Indexer.Supervisor, :start_link,
[[option: :value]]},
type: :supervisor
}
"""
def child_spec(opts) do
%{
id: __MODULE__,
start: {Explorer.Indexer.Supervisor, :start_link, [opts]},
restart: :permanent,
shutdown: 5000,
type: :supervisor
}
end
@doc """ @doc """
The maximum `t:Explorer.Chain.Block.t/0` `number` that was indexed The maximum `t:Explorer.Chain.Block.t/0` `number` that was indexed

@ -8,7 +8,7 @@ defmodule Explorer.Indexer.Supervisor do
alias Explorer.Indexer.{AddressFetcher, BlockFetcher} alias Explorer.Indexer.{AddressFetcher, BlockFetcher}
def start_link(opts) do def start_link(opts) do
Supervisor.start_link(__MODULE__, opts) Supervisor.start_link(__MODULE__, opts, name: __MODULE__)
end end
@impl Supervisor @impl Supervisor

Loading…
Cancel
Save