defmodule DaProductApp.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 # Initialize ETS cache for RespChkTxn ref_data # Check if table already exists before creating to avoid error unless :ets.whereis(:ref_data_cache) do :ets.new(:ref_data_cache, [:set, :public, :named_table]) end children = [ DaProductAppWeb.Telemetry, DaProductApp.Repo, {DNSCluster, query: Application.get_env(:da_product_app, :dns_cluster_query) || :ignore}, {Phoenix.PubSub, name: DaProductApp.PubSub}, # Start the Finch HTTP client for sending emails {Finch, name: DaProductApp.Finch}, # Start rate limiter cache {Cachex, name: :rate_limiter, limit: 50_000}, # Start a worker by calling: DaProductApp.Worker.start_link(arg) # {DaProductApp.Worker, arg}, #DaProductApp.Transactions.Watchdog, we need to remove the commment # Start timeout simulation handler(remove this later ) DaProductApp.SpecialHandlers.TimeoutSimulationHandler, # Start static QR timeout simulation handler (remove this later ) DaProductApp.SpecialHandlers.StaticTimeoutSimulationHandler, # Start to serve requests, typically the last entry DaProductAppWeb.Endpoint ] # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options opts = [strategy: :one_for_one, name: DaProductApp.Supervisor] Supervisor.start_link(children, opts) end # Tell Phoenix to update the endpoint configuration # whenever the application is updated. @impl true def config_change(changed, _new, removed) do DaProductAppWeb.Endpoint.config_change(changed, removed) :ok end end