From 3f760c79bfc5b2a315543ed262eb9ac52e341e80 Mon Sep 17 00:00:00 2001 From: cmaddox5 Date: Mon, 28 Oct 2024 09:12:25 -0400 Subject: [PATCH 1/2] Add workaround for an error. --- lib/screens/health.ex | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/screens/health.ex b/lib/screens/health.ex index afc5f49f4..b03c1d7be 100644 --- a/lib/screens/health.ex +++ b/lib/screens/health.ex @@ -81,10 +81,20 @@ defmodule Screens.Health do defp process_metrics({pid, name, supervisor}) do metrics = pid - |> :recon.info(@process_metrics) + |> safe_recon_info(@process_metrics) |> Stream.map(fn {metric, value} -> "#{metric}=#{value}" end) |> Enum.intersperse(" ") {name, supervisor, metrics} end + + # work around https://github.com/ferd/recon/issues/95 + # The issue is closed but is still very much an issue. + @spec safe_recon_info(pid(), [atom()]) :: + [] | [{:recon.info_type(), [{:recon.info_key(), term()}]}] + defp safe_recon_info(pid, metrics) do + :recon.info(pid, metrics) + rescue + FunctionClauseError -> [] + end end From 9a7f4a2c4e7cab028993d3174fd5b422bd359695 Mon Sep 17 00:00:00 2001 From: cmaddox5 Date: Mon, 28 Oct 2024 10:00:08 -0400 Subject: [PATCH 2/2] Only reference issue link. --- lib/screens/health.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/screens/health.ex b/lib/screens/health.ex index b03c1d7be..9ad918432 100644 --- a/lib/screens/health.ex +++ b/lib/screens/health.ex @@ -89,7 +89,6 @@ defmodule Screens.Health do end # work around https://github.com/ferd/recon/issues/95 - # The issue is closed but is still very much an issue. @spec safe_recon_info(pid(), [atom()]) :: [] | [{:recon.info_type(), [{:recon.info_key(), term()}]}] defp safe_recon_info(pid, metrics) do