Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Recon error workaround. #2267

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/screens/health.ex
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,19 @@ 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
@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
Loading