| 1 |
|
defmodule DaProductApp.Application do |
| 2 |
|
# See https://hexdocs.pm/elixir/Application.html |
| 3 |
|
# for more information on OTP Applications |
| 4 |
|
@moduledoc false |
| 5 |
|
|
| 6 |
|
use Application |
| 7 |
|
|
| 8 |
|
@impl true |
| 9 |
|
def start(_type, _args) do |
| 10 |
1 |
children = [ |
| 11 |
|
DaProductAppWeb.Telemetry, |
| 12 |
|
DaProductApp.Repo, |
| 13 |
1 |
{DNSCluster, query: Application.get_env(:da_product_app, :dns_cluster_query) || :ignore}, |
| 14 |
|
{Phoenix.PubSub, name: DaProductApp.PubSub}, |
| 15 |
|
# Start the Finch HTTP client for sending emails |
| 16 |
|
{Finch, name: DaProductApp.Finch}, |
| 17 |
|
# Start rate limiter cache |
| 18 |
|
{Cachex, name: :rate_limiter, limit: 50_000}, |
| 19 |
|
# Start a worker by calling: DaProductApp.Worker.start_link(arg) |
| 20 |
|
# {DaProductApp.Worker, arg}, |
| 21 |
|
DaProductApp.Transactions.Watchdog, |
| 22 |
|
# Start to serve requests, typically the last entry |
| 23 |
|
DaProductAppWeb.Endpoint |
| 24 |
|
] |
| 25 |
|
|
| 26 |
|
# See https://hexdocs.pm/elixir/Supervisor.html |
| 27 |
|
# for other strategies and supported options |
| 28 |
1 |
opts = [strategy: :one_for_one, name: DaProductApp.Supervisor] |
| 29 |
1 |
Supervisor.start_link(children, opts) |
| 30 |
|
end |
| 31 |
|
|
| 32 |
|
# Tell Phoenix to update the endpoint configuration |
| 33 |
|
# whenever the application is updated. |
| 34 |
|
@impl true |
| 35 |
|
def config_change(changed, _new, removed) do |
| 36 |
:-( |
DaProductAppWeb.Endpoint.config_change(changed, removed) |
| 37 |
|
:ok |
| 38 |
|
end |
| 39 |
|
end |