~ihabunek/triglav

ref: 3a1876166aa129c76c1b09fc562af764d04df4e1 triglav/lib/triglav/application.ex -rw-r--r-- 729 bytes
3a187616Ivan Habunek Fix detecting unexpected master route members 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
defmodule Triglav.Application do
  @moduledoc false

  use Application

  def start(_type, _args) do
    minimal = Application.get_env(:triglav, :repo_only, false)

    children =
      if minimal do
        [Triglav.Repo]
      else
        [
          Triglav.Repo,
          TriglavWeb.Telemetry,
          {Phoenix.PubSub, name: Triglav.PubSub},
          TriglavWeb.Endpoint,
        ]
      end

    opts = [strategy: :one_for_one, name: Triglav.Supervisor]
    Supervisor.start_link(children, opts)
  end

  # Tell Phoenix to update the endpoint configuration
  # whenever the application is updated.
  def config_change(changed, _new, removed) do
    TriglavWeb.Endpoint.config_change(changed, removed)
    :ok
  end
end