|
@@ -19,6 +19,7 @@
|
|
|
-behaviour(application).
|
|
-behaviour(application).
|
|
|
|
|
|
|
|
-export([ start/2
|
|
-export([ start/2
|
|
|
|
|
+ , prep_stop/1
|
|
|
, stop/1
|
|
, stop/1
|
|
|
, get_description/0
|
|
, get_description/0
|
|
|
, get_release/0
|
|
, get_release/0
|
|
@@ -50,12 +51,14 @@ start(_Type, _Args) ->
|
|
|
print_vsn(),
|
|
print_vsn(),
|
|
|
{ok, Sup}.
|
|
{ok, Sup}.
|
|
|
|
|
|
|
|
--spec(stop(State :: term()) -> term()).
|
|
|
|
|
-stop(_State) ->
|
|
|
|
|
|
|
+prep_stop(_State) ->
|
|
|
ok = emqx_alarm_handler:unload(),
|
|
ok = emqx_alarm_handler:unload(),
|
|
|
emqx_boot:is_enabled(listeners)
|
|
emqx_boot:is_enabled(listeners)
|
|
|
andalso emqx_listeners:stop().
|
|
andalso emqx_listeners:stop().
|
|
|
|
|
|
|
|
|
|
+stop(_State) ->
|
|
|
|
|
+ ok.
|
|
|
|
|
+
|
|
|
set_backtrace_depth() ->
|
|
set_backtrace_depth() ->
|
|
|
Depth = application:get_env(?APP, backtrace_depth, 16),
|
|
Depth = application:get_env(?APP, backtrace_depth, 16),
|
|
|
_ = erlang:system_flag(backtrace_depth, Depth),
|
|
_ = erlang:system_flag(backtrace_depth, Depth),
|