fix(statsd): update config bug

This commit is contained in:
DDDHuang 2022-01-04 11:07:58 +08:00
parent 7bc59969eb
commit e908973a86
1 changed files with 2 additions and 4 deletions

View File

@ -61,10 +61,8 @@ statsd(put, #{body := Body}) ->
{ok, #{raw_config := NewConfig, config := Config}} -> {ok, #{raw_config := NewConfig, config := Config}} ->
ok = emqx_statsd_sup:ensure_child_stopped(?APP), ok = emqx_statsd_sup:ensure_child_stopped(?APP),
case maps:get(<<"enable">>, Body) of case maps:get(<<"enable">>, Body) of
true -> true -> emqx_statsd_sup:ensure_child_started(?APP, Config);
ok = emqx_statsd_sup:ensure_child_started(?APP, maps:get(config, Config)); false -> ok
false ->
ok
end, end,
{200, NewConfig}; {200, NewConfig};
{error, Reason} -> {error, Reason} ->