Start emqx-modules application by default (#4518)
* fix(modules): start emqx_modules by default * chore(test): eliminate some compile warnings
This commit is contained in:
parent
b5edba7729
commit
16c999ed9b
|
@ -17,6 +17,7 @@
|
||||||
-module(emqx_auth_pgsql_SUITE).
|
-module(emqx_auth_pgsql_SUITE).
|
||||||
|
|
||||||
-compile(export_all).
|
-compile(export_all).
|
||||||
|
-compile(nowarn_export_all).
|
||||||
|
|
||||||
-define(POOL, emqx_auth_pgsql).
|
-define(POOL, emqx_auth_pgsql).
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
-module(emqx_auth_redis_SUITE).
|
-module(emqx_auth_redis_SUITE).
|
||||||
|
|
||||||
-compile(export_all).
|
-compile(export_all).
|
||||||
|
-compile(nowarn_export_all).
|
||||||
|
|
||||||
-include_lib("emqx/include/emqx.hrl").
|
-include_lib("emqx/include/emqx.hrl").
|
||||||
|
|
||||||
|
|
|
@ -325,9 +325,6 @@ peer2addr({Host, _}) ->
|
||||||
peer2addr(Host) ->
|
peer2addr(Host) ->
|
||||||
list_to_binary(inet:ntoa(Host)).
|
list_to_binary(inet:ntoa(Host)).
|
||||||
|
|
||||||
ensure_to_binary(Atom) when is_atom(Atom) -> atom_to_binary(Atom, utf8);
|
|
||||||
ensure_to_binary(Bin) when is_binary(Bin) -> Bin.
|
|
||||||
|
|
||||||
stringfy({shutdown, Reason}) ->
|
stringfy({shutdown, Reason}) ->
|
||||||
stringfy(Reason);
|
stringfy(Reason);
|
||||||
stringfy(Term) when is_atom(Term); is_binary(Term) ->
|
stringfy(Term) when is_atom(Term); is_binary(Term) ->
|
||||||
|
@ -343,17 +340,6 @@ receive_http_request_body() ->
|
||||||
exit(waiting_message_timeout)
|
exit(waiting_message_timeout)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
receive_http_request_bodys() ->
|
|
||||||
receive_http_request_bodys_([]).
|
|
||||||
|
|
||||||
receive_http_request_bodys_(Acc) ->
|
|
||||||
receive
|
|
||||||
{post, _, _, Body} ->
|
|
||||||
receive_http_request_bodys_([Body|Acc])
|
|
||||||
after 1000 ->
|
|
||||||
lists:reverse(Acc)
|
|
||||||
end.
|
|
||||||
|
|
||||||
filter_topictab(TopicTab, {undefined}) ->
|
filter_topictab(TopicTab, {undefined}) ->
|
||||||
TopicTab;
|
TopicTab;
|
||||||
filter_topictab(TopicTab, {TopicFilter}) ->
|
filter_topictab(TopicTab, {TopicFilter}) ->
|
||||||
|
@ -399,9 +385,6 @@ topic_filter_env() ->
|
||||||
payload_encode() ->
|
payload_encode() ->
|
||||||
oneof([base62, base64, undefined]).
|
oneof([base62, base64, undefined]).
|
||||||
|
|
||||||
http_code() ->
|
|
||||||
oneof([socket_closed_remotely, others]).
|
|
||||||
|
|
||||||
disconnected_conninfo() ->
|
disconnected_conninfo() ->
|
||||||
?LET(Info, conninfo(),
|
?LET(Info, conninfo(),
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{vsn, "4.3.0"}, % strict semver, bump manually!
|
{vsn, "4.3.0"}, % strict semver, bump manually!
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_telemetry_sup]},
|
{registered, [emqx_telemetry_sup]},
|
||||||
{applications, [kernel,stdlib,emqx_modules]},
|
{applications, [kernel,stdlib]},
|
||||||
{mod, {emqx_telemetry_app,[]}},
|
{mod, {emqx_telemetry_app,[]}},
|
||||||
{env, []},
|
{env, []},
|
||||||
{licenses, ["Apache-2.0"]},
|
{licenses, ["Apache-2.0"]},
|
||||||
|
|
14
src/emqx.erl
14
src/emqx.erl
|
@ -234,10 +234,20 @@ shutdown(Reason) ->
|
||||||
?LOG(critical, "emqx shutdown for ~s", [Reason]),
|
?LOG(critical, "emqx shutdown for ~s", [Reason]),
|
||||||
_ = emqx_alarm_handler:unload(),
|
_ = emqx_alarm_handler:unload(),
|
||||||
_ = emqx_plugins:unload(),
|
_ = emqx_plugins:unload(),
|
||||||
lists:foreach(fun application:stop/1, [emqx, ekka, cowboy, ranch, esockd, gproc]).
|
lists:foreach(fun application:stop/1
|
||||||
|
, lists:reverse(default_started_applications())
|
||||||
|
).
|
||||||
|
|
||||||
reboot() ->
|
reboot() ->
|
||||||
lists:foreach(fun application:start/1, [gproc, esockd, ranch, cowboy, ekka, emqx]).
|
lists:foreach(fun application:start/1 , default_started_applications()).
|
||||||
|
|
||||||
|
-ifdef(EMQX_ENTERPRISE).
|
||||||
|
default_started_applications() ->
|
||||||
|
[gproc, esockd, ranch, cowboy, ekka, emqx].
|
||||||
|
-else.
|
||||||
|
default_started_applications() ->
|
||||||
|
[gproc, esockd, ranch, cowboy, ekka, emqx, emqx_modules].
|
||||||
|
-endif.
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
|
|
|
@ -86,8 +86,7 @@ init_per_testcase(TestCase, Config) when
|
||||||
init_per_testcase(_, Config) ->
|
init_per_testcase(_, Config) ->
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
|
end_per_testcase(TestCase, _Config) when
|
||||||
end_per_testcase(TestCase, Config) when
|
|
||||||
TestCase =/= t_ws_sub_protocols_mqtt_equivalents,
|
TestCase =/= t_ws_sub_protocols_mqtt_equivalents,
|
||||||
TestCase =/= t_ws_sub_protocols_mqtt,
|
TestCase =/= t_ws_sub_protocols_mqtt,
|
||||||
TestCase =/= t_ws_check_origin,
|
TestCase =/= t_ws_check_origin,
|
||||||
|
|
Loading…
Reference in New Issue