diff --git a/lib/chronoscope/application.ex b/lib/chronoscope/application.ex index 79488ab..d2e16ca 100644 --- a/lib/chronoscope/application.ex +++ b/lib/chronoscope/application.ex @@ -17,7 +17,6 @@ defmodule Chronoscope.Application do # {Chronoscope.Worker, arg}, {DynamicSupervisor, name: Chronoscope.DynamicSupervisor, strategy: :one_for_one}, {Task.Supervisor, name: Chronoscope.TaskSupervisor}, - Chronoscope.NTS.Client, # Start to serve requests, typically the last entry ChronoscopeWeb.Endpoint ] diff --git a/lib/chronoscope/nts.ex b/lib/chronoscope/nts.ex index 5f12213..06d7798 100644 --- a/lib/chronoscope/nts.ex +++ b/lib/chronoscope/nts.ex @@ -14,13 +14,14 @@ defmodule Chronoscope.NTS do end def list() do - DynamicSupervisor.count_children(Chronoscope.DynamicSupervisor) - |> IO.inspect() + Chronoscope.DynamicSupervisor + |> DynamicSupervisor.which_children() + |> Enum.map(fn {_, pid, _, _} -> GenServer.call(pid, :list) end) end def key_establishment(host, port) do # todo don't use atoms for this - name = String.to_atom("#{host}#{port}") + name = String.to_atom("#{host}:#{port}") if GenServer.whereis(name) == nil do DynamicSupervisor.start_child(Chronoscope.DynamicSupervisor, {NTS.Client, name: name})