Files
customer-service/lib/customer_service/application.ex
HaimKortovich 4519f797fd
All checks were successful
Build and Publish / build-release (push) Successful in 3m7s
partition by org_id and add auth
2026-05-15 10:08:54 -05:00

46 lines
1.2 KiB
Elixir

defmodule CustomerService.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
@impl true
def start(_type, _args) do
oidcc_child =
case Application.get_env(:customer_service, :zitadel) do
nil ->
[]
cfg ->
[
{Oidcc.ProviderConfiguration.Worker,
%{
issuer: cfg[:issuer],
name: CustomerService.ZitadelProvider
}}
]
end
children = [
CustomerService.CommandedApp,
CustomerService.Repo,
CustomerService.Projectors.Customer,
CustomerService.Projectors.QuickLead,
CustomerServiceWeb.Telemetry,
{DNSCluster, query: Application.get_env(:customer_service, :dns_cluster_query) || :ignore},
{Phoenix.PubSub, name: CustomerService.PubSub}
| oidcc_child ++ [CustomerServiceWeb.Endpoint]
]
opts = [strategy: :one_for_one, name: CustomerService.Supervisor]
Supervisor.start_link(children, opts)
end
@impl true
def config_change(changed, _new, removed) do
CustomerServiceWeb.Endpoint.config_change(changed, removed)
:ok
end
end