Merge pull request #8546 from thalesmg/fix-dashboard-cluster-rate

fix: dashboard monitor crash after badrpc
This commit is contained in:
Thales Macedo Garitezi 2022-07-22 09:10:41 -03:00 committed by GitHub
commit 2e75c35995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -115,13 +115,16 @@ granularity_adapter(List) ->
%% Get the current rate. Not the current sampler data.
current_rate() ->
Fun =
fun(Node, Cluster) ->
case current_rate(Node) of
{ok, CurrentRate} ->
merge_cluster_rate(CurrentRate, Cluster);
{badrpc, Reason} ->
{badrpc, {Node, Reason}}
end
fun
(Node, Cluster) when is_map(Cluster) ->
case current_rate(Node) of
{ok, CurrentRate} ->
merge_cluster_rate(CurrentRate, Cluster);
{badrpc, Reason} ->
{badrpc, {Node, Reason}}
end;
(_Node, Error) ->
Error
end,
case lists:foldl(Fun, #{}, mria_mnesia:cluster_nodes(running)) of
{badrpc, Reason} ->