From 59e2614574b6cff5837a6524b4c07f98930d8edb Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Sat, 1 Jan 2022 04:23:51 +0800 Subject: [PATCH] fix(dialyzer): unmatched results in emqx_statsd_api --- apps/emqx_statsd/src/emqx_statsd_api.erl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/emqx_statsd/src/emqx_statsd_api.erl b/apps/emqx_statsd/src/emqx_statsd_api.erl index 2278fa492..d545003b0 100644 --- a/apps/emqx_statsd/src/emqx_statsd_api.erl +++ b/apps/emqx_statsd/src/emqx_statsd_api.erl @@ -59,12 +59,10 @@ 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), case maps:get(<<"enable">>, Body) of - true -> - _ = emqx_statsd_sup:stop_child(?APP), - emqx_statsd_sup:start_child(?APP, maps:get(config, Config)); - false -> - _ = emqx_statsd_sup:stop_child(?APP) + true -> emqx_statsd_sup:start_child(?APP, maps:get(config, Config)); + false -> ok end, {200, NewConfig}; {error, Reason} ->