Clean up code
This commit is contained in:
parent
572ccd1ee8
commit
0a6858fa4a
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue