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

This commit is contained in:
Сергей Прохоров 2019-01-20 21:51:32 +01:00
parent bf01459be5
commit e9f999a151
No known key found for this signature in database
GPG key ID: 1C570244E4EF3337

View file

@ -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.
%%====================================================================