Current section

Files

Jump to
geolix lib geolix supervisor.ex
Raw

lib/geolix/supervisor.ex

defmodule Geolix.Supervisor do
@moduledoc """
Geolix Supervisor.
"""
use Supervisor
alias Geolix.Database
alias Geolix.Server.Pool
@doc """
Starts the supervisor.
"""
@spec start_link(term) :: Supervisor.on_start()
def start_link(default \\ []) do
Supervisor.start_link(__MODULE__, default, name: __MODULE__)
end
@doc false
def init(_default) do
:ok =
case Application.get_env(:geolix, :init) do
nil -> :ok
{mod, fun} -> apply(mod, fun, [])
end
children = [
Pool.child_spec(),
supervisor(Database.Supervisor, [])
]
supervise(children, strategy: :one_for_one)
end
end