fix: api total accumulate ignore `undefined` by down nodes result
This commit is contained in:
parent
65aee8870b
commit
060074e04a
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_authn, [
|
{application, emqx_authn, [
|
||||||
{description, "EMQX Authentication"},
|
{description, "EMQX Authentication"},
|
||||||
{vsn, "0.1.24"},
|
{vsn, "0.1.25"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_authn_sup, emqx_authn_registry]},
|
{registered, [emqx_authn_sup, emqx_authn_registry]},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{id, "emqx_machine"},
|
{id, "emqx_machine"},
|
||||||
{description, "The EMQX Machine"},
|
{description, "The EMQX Machine"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "0.2.11"},
|
{vsn, "0.2.12"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, emqx_ctl]},
|
{applications, [kernel, stdlib, emqx_ctl]},
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{application, emqx_management, [
|
{application, emqx_management, [
|
||||||
{description, "EMQX Management API and CLI"},
|
{description, "EMQX Management API and CLI"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "5.0.27"},
|
{vsn, "5.0.28"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_management_sup]},
|
{registered, [emqx_management_sup]},
|
||||||
{applications, [kernel, stdlib, emqx_plugins, minirest, emqx, emqx_ctl, emqx_bridge_http]},
|
{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#{hasnext => HasNext}, QueryState).
|
||||||
|
|
||||||
maybe_accumulate_totals(Result, #{total := TotalAcc}) ->
|
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};
|
Result#{total => QueryTotal};
|
||||||
maybe_accumulate_totals(Result, _QueryState) ->
|
maybe_accumulate_totals(Result, _QueryState) ->
|
||||||
Result.
|
Result.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{application, emqx_retainer, [
|
{application, emqx_retainer, [
|
||||||
{description, "EMQX Retainer"},
|
{description, "EMQX Retainer"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "5.0.16"},
|
{vsn, "5.0.17"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_retainer_sup]},
|
{registered, [emqx_retainer_sup]},
|
||||||
{applications, [kernel, stdlib, emqx, emqx_ctl]},
|
{applications, [kernel, stdlib, emqx, emqx_ctl]},
|
||||||
|
|
Loading…
Reference in New Issue