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. %% Get the current rate. Not the current sampler data.
current_rate() -> current_rate() ->
Fun = Fun =
fun(Node, Cluster) -> fun
case current_rate(Node) of (Node, Cluster) when is_map(Cluster) ->
{ok, CurrentRate} -> case current_rate(Node) of
merge_cluster_rate(CurrentRate, Cluster); {ok, CurrentRate} ->
{badrpc, Reason} -> merge_cluster_rate(CurrentRate, Cluster);
{badrpc, {Node, Reason}} {badrpc, Reason} ->
end {badrpc, {Node, Reason}}
end;
(_Node, Error) ->
Error
end, end,
case lists:foldl(Fun, #{}, mria_mnesia:cluster_nodes(running)) of case lists:foldl(Fun, #{}, mria_mnesia:cluster_nodes(running)) of
{badrpc, Reason} -> {badrpc, Reason} ->