Merge pull request #11431 from JimMoen/fix-mgmt-api-500
fix: api total accumulate ignore `undefined` by down nodes result
This commit is contained in:
commit
4e974851e0
|
@ -1,7 +1,7 @@
|
|||
%% -*- mode: erlang -*-
|
||||
{application, emqx_authn, [
|
||||
{description, "EMQX Authentication"},
|
||||
{vsn, "0.1.24"},
|
||||
{vsn, "0.1.25"},
|
||||
{modules, []},
|
||||
{registered, [emqx_authn_sup, emqx_authn_registry]},
|
||||
{applications, [
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{id, "emqx_machine"},
|
||||
{description, "The EMQX Machine"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "0.2.11"},
|
||||
{vsn, "0.2.12"},
|
||||
{modules, []},
|
||||
{registered, []},
|
||||
{applications, [kernel, stdlib, emqx_ctl]},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{application, emqx_management, [
|
||||
{description, "EMQX Management API and CLI"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "5.0.27"},
|
||||
{vsn, "5.0.28"},
|
||||
{modules, []},
|
||||
{registered, [emqx_management_sup]},
|
||||
{applications, [kernel, stdlib, emqx_plugins, minirest, emqx, emqx_ctl, emqx_bridge_http]},
|
||||
|
|
|
@ -460,7 +460,11 @@ finalize_query(Result = #{overflow := Overflow}, QueryState = #{complete := Comp
|
|||
maybe_accumulate_totals(Result#{hasnext => HasNext}, QueryState).
|
||||
|
||||
maybe_accumulate_totals(Result, #{total := TotalAcc}) ->
|
||||
QueryTotal = maps:fold(fun(_Node, T, N) -> N + T end, 0, TotalAcc),
|
||||
AccFun = fun
|
||||
(_Node, NodeTotal, AccIn) when is_number(NodeTotal) -> AccIn + NodeTotal;
|
||||
(_Node, _, AccIn) -> AccIn
|
||||
end,
|
||||
QueryTotal = maps:fold(AccFun, 0, TotalAcc),
|
||||
Result#{total => QueryTotal};
|
||||
maybe_accumulate_totals(Result, _QueryState) ->
|
||||
Result.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{application, emqx_retainer, [
|
||||
{description, "EMQX Retainer"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "5.0.16"},
|
||||
{vsn, "5.0.17"},
|
||||
{modules, []},
|
||||
{registered, [emqx_retainer_sup]},
|
||||
{applications, [kernel, stdlib, emqx, emqx_ctl]},
|
||||
|
|
Loading…
Reference in New Issue