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

parent bf01459b
......@@ -8,7 +8,7 @@
-behaviour(application).
%% 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).
%%====================================================================
......@@ -23,8 +23,11 @@ start(_StartType, _StartArgs) ->
Res.
%%--------------------------------------------------------------------
stop(_State) ->
prep_stop(State) ->
[stop_proxy(Where) || Where <- application:get_env(?APP, ports, [])],
State.
stop(_State) ->
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