Stop ranch listeners in 'prep_stop', not 'stop' application callback

parent bf01459b
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
-behaviour(application). -behaviour(application).
%% Application callbacks %% Application callbacks
-export([start/2, stop/1, start_proxy/1]). -export([start/2, prep_stop/1, stop/1, start_proxy/1]).
-define(APP, mtproto_proxy). -define(APP, mtproto_proxy).
%%==================================================================== %%====================================================================
...@@ -23,8 +23,11 @@ start(_StartType, _StartArgs) -> ...@@ -23,8 +23,11 @@ start(_StartType, _StartArgs) ->
Res. Res.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
stop(_State) -> prep_stop(State) ->
[stop_proxy(Where) || Where <- application:get_env(?APP, ports, [])], [stop_proxy(Where) || Where <- application:get_env(?APP, ports, [])],
State.
stop(_State) ->
ok. ok.
%%==================================================================== %%====================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment