fix: compile error

This commit is contained in:
zhongwencool 2022-01-04 09:37:32 +08:00
parent 33523d9294
commit 075669461c
1 changed files with 3 additions and 3 deletions

View File

@ -59,13 +59,13 @@ statsd(put, #{body := Body}) ->
Body,
#{rawconf_with_defaults => true, override_to => cluster}) of
{ok, #{raw_config := NewConfig, config := Config}} ->
_ = emqx_statsd_sup:stop_child(?APP),
ok = emqx_statsd_sup:ensure_child_stopped(?APP),
case maps:get(<<"enable">>, Body) of
true ->
ok = emqx_statsd_sup:ensure_child_stopped(?APP),
ok = emqx_statsd_sup:ensure_child_started(?APP, maps:get(config, Config));
false ->
ok = emqx_statsd_sup:ensure_child_stopped(?APP)
ok
end,
{200, NewConfig};
{error, Reason} ->
Message = list_to_binary(io_lib:format("Update config failed ~p", [Reason])),