fix(config): update config by emqx_conf

This commit is contained in:
DDDHuang 2022-01-05 16:11:55 +08:00
parent 31aed3ea8e
commit 6c574c08b8
2 changed files with 4 additions and 4 deletions

View File

@ -73,7 +73,7 @@
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% update new config %% update new config
update(Config) -> update(Config) ->
case emqx:update_config([prometheus], Config, case emqx_conf:update([prometheus], Config,
#{rawconf_with_defaults => true, override_to => cluster}) of #{rawconf_with_defaults => true, override_to => cluster}) of
{ok, #{raw_config := NewConfigRows}} -> {ok, #{raw_config := NewConfigRows}} ->
case maps:get(<<"enable">>, Config, true) of case maps:get(<<"enable">>, Config, true) of

View File

@ -57,14 +57,14 @@
}). }).
update(Config) -> update(Config) ->
case emqx:update_config([statsd], case emqx_conf:update([statsd],
Config, Config,
#{rawconf_with_defaults => true, override_to => cluster}) of #{rawconf_with_defaults => true, override_to => cluster}) of
{ok, #{raw_config := NewConfigRows}} -> {ok, #{raw_config := NewConfigRows}} ->
_ = start(), ok = stop(),
case maps:get(<<"enable">>, Config, true) of case maps:get(<<"enable">>, Config, true) of
true -> true ->
ok = stop(); ok = start();
false -> false ->
ignore ignore
end, end,