fix(statsd): already_started crash and diaylizer warning

This commit is contained in:
zhongwencool 2021-12-31 17:23:47 +08:00
parent d0e8285e93
commit 2a0d8752bd
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ statsd(put, #{body := Body}) ->
case maps:get(<<"enable">>, Body) of case maps:get(<<"enable">>, Body) of
true -> true ->
_ = emqx_statsd_sup:stop_child(?APP), _ = emqx_statsd_sup:stop_child(?APP),
emqx_statsd_sup:start_child(?APP, maps:get(config, Config)); _ = emqx_statsd_sup:start_child(?APP, maps:get(config, Config));
false -> false ->
_ = emqx_statsd_sup:stop_child(?APP) _ = emqx_statsd_sup:stop_child(?APP)
end, end,

View File

@ -50,5 +50,5 @@ init([]) ->
assert_started({ok, _Pid}) -> ok; assert_started({ok, _Pid}) -> ok;
assert_started({ok, _Pid, _Info}) -> ok; assert_started({ok, _Pid, _Info}) -> ok;
assert_started({error, {already_tarted, _Pid}}) -> ok; assert_started({error, {already_started, _Pid}}) -> ok;
assert_started({error, Reason}) -> erlang:error(Reason). assert_started({error, Reason}) -> erlang:error(Reason).