Add feature to disable listening
All checks were successful
Build & Test / nix-build (push) Successful in 1m12s
All checks were successful
Build & Test / nix-build (push) Successful in 1m12s
This commit is contained in:
parent
3e6cc5273d
commit
4e629fb8e4
@ -24,11 +24,15 @@ defmodule Amethyst.Application do
|
|||||||
@impl true
|
@impl true
|
||||||
def start(_type, _args) do
|
def start(_type, _args) do
|
||||||
children = [
|
children = [
|
||||||
Supervisor.child_spec({Task, fn -> Amethyst.TCPListener.accept(Application.fetch_env!(:amethyst, :port)) end}, restart: :permanent),
|
|
||||||
{Task.Supervisor, name: Amethyst.ConnectionSupervisor},
|
{Task.Supervisor, name: Amethyst.ConnectionSupervisor},
|
||||||
{Amethyst.Keys, 1024},
|
{Amethyst.Keys, 1024},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
children = case Application.fetch_env!(:amethyst, :port) do
|
||||||
|
:no_listen -> children
|
||||||
|
port -> [Supervisor.child_spec({Task, fn -> Amethyst.TCPListener.accept(port) end}, restart: :permanent) | children]
|
||||||
|
end
|
||||||
|
|
||||||
# See https://hexdocs.pm/elixir/Supervisor.html
|
# See https://hexdocs.pm/elixir/Supervisor.html
|
||||||
# for other strategies and supported options
|
# for other strategies and supported options
|
||||||
opts = [strategy: :one_for_one, name: Amethyst.Supervisor]
|
opts = [strategy: :one_for_one, name: Amethyst.Supervisor]
|
||||||
|
Loading…
Reference in New Issue
Block a user