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:
JianBo He 2023-06-14 16:06:31 +08:00 committed by GitHub
commit 5fdf73bc03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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).