From 0a6858fa4a955adc626795bd0a3619a5a8cccaf5 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Wed, 27 Mar 2024 09:19:21 -0400 Subject: [PATCH] Clean up code --- lib/chronoscope/nts/client.ex | 7 +------ lib/chronoscope/nts/key_establishment_client.ex | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/chronoscope/nts/client.ex b/lib/chronoscope/nts/client.ex index cad443e..04ab01c 100644 --- a/lib/chronoscope/nts/client.ex +++ b/lib/chronoscope/nts/client.ex @@ -31,12 +31,6 @@ defmodule Chronoscope.NTS.Client do {:reply, get_response(server, new_state), new_state} end - # fixme - remove - @impl true - def handle_info(_, state) do - {:noreply, state} - end - defp update_state(server, state) do now = DateTime.utc_now() last_key_establishment = get_last_key_establishment(server, state, now) @@ -68,6 +62,7 @@ defmodule Chronoscope.NTS.Client do end defp current_data(server, now) do + # fixme - handle each request asynchronously response = Chronoscope.TaskSupervisor |> Task.Supervisor.async(fn -> KeyEstablishmentClient.key_establishment(server) end) diff --git a/lib/chronoscope/nts/key_establishment_client.ex b/lib/chronoscope/nts/key_establishment_client.ex index aa5d996..bf1b77c 100644 --- a/lib/chronoscope/nts/key_establishment_client.ex +++ b/lib/chronoscope/nts/key_establishment_client.ex @@ -31,7 +31,6 @@ defmodule Chronoscope.NTS.KeyEstablishmentClient do :ok = :ssl.send(socket, KeyEstablishmentRequest.create()) {:ok, peercert} = :ssl.peercert(socket) - # fixme - don't use receive inside genserver receive do {:ssl, _socket, response} -> :ssl.close(socket)