From 3f760c79bfc5b2a315543ed262eb9ac52e341e80 Mon Sep 17 00:00:00 2001 From: cmaddox5 Date: Mon, 28 Oct 2024 09:12:25 -0400 Subject: [PATCH] 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