Clean up code

This commit is contained in:
Mike Cifelli 2024-03-27 09:19:21 -04:00
parent 572ccd1ee8
commit 0a6858fa4a
Signed by: mike
GPG Key ID: 6B08C6BE47D08E4C
2 changed files with 1 additions and 7 deletions

View File

@ -31,12 +31,6 @@ defmodule Chronoscope.NTS.Client do
{:reply, get_response(server, new_state), new_state} {:reply, get_response(server, new_state), new_state}
end end
# fixme - remove
@impl true
def handle_info(_, state) do
{:noreply, state}
end
defp update_state(server, state) do defp update_state(server, state) do
now = DateTime.utc_now() now = DateTime.utc_now()
last_key_establishment = get_last_key_establishment(server, state, now) last_key_establishment = get_last_key_establishment(server, state, now)
@ -68,6 +62,7 @@ defmodule Chronoscope.NTS.Client do
end end
defp current_data(server, now) do defp current_data(server, now) do
# fixme - handle each request asynchronously
response = response =
Chronoscope.TaskSupervisor Chronoscope.TaskSupervisor
|> Task.Supervisor.async(fn -> KeyEstablishmentClient.key_establishment(server) end) |> Task.Supervisor.async(fn -> KeyEstablishmentClient.key_establishment(server) end)

View File

@ -31,7 +31,6 @@ defmodule Chronoscope.NTS.KeyEstablishmentClient do
:ok = :ssl.send(socket, KeyEstablishmentRequest.create()) :ok = :ssl.send(socket, KeyEstablishmentRequest.create())
{:ok, peercert} = :ssl.peercert(socket) {:ok, peercert} = :ssl.peercert(socket)
# fixme - don't use receive inside genserver
receive do receive do
{:ssl, _socket, response} -> {:ssl, _socket, response} ->
:ssl.close(socket) :ssl.close(socket)