Merge pull request #11044 from emqx/fix-monitor-api-crash
fix(http): avoid crash if the old sample data dont contain `live_conn…
This commit is contained in:
commit
5fdf73bc03
|
@ -249,7 +249,7 @@ merge_cluster_sampler_map(M1, M2) ->
|
||||||
(topics, Map) ->
|
(topics, Map) ->
|
||||||
Map#{topics => maps:get(topics, M1)};
|
Map#{topics => maps:get(topics, M1)};
|
||||||
(Key, Map) ->
|
(Key, Map) ->
|
||||||
Map#{Key => maps:get(Key, M1) + maps:get(Key, M2)}
|
Map#{Key => maps:get(Key, M1, 0) + maps:get(Key, M2, 0)}
|
||||||
end,
|
end,
|
||||||
lists:foldl(Fun, #{}, ?SAMPLER_LIST).
|
lists:foldl(Fun, #{}, ?SAMPLER_LIST).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue