25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Don't register listeners that failed to start in config reload

This should alleviate some issues in #3850
This commit is contained in:
Paweł Chmielowski 2022-06-21 11:09:37 +02:00
parent 46c947bc76
commit 06147deccd

View File

@ -457,11 +457,19 @@ config_reloaded() ->
ok;
{_, OldModule, OldOpts} ->
_ = stop_listener(EndPoint, OldModule, OldOpts),
ets:insert(?MODULE, {EndPoint, Module, Opts}),
start_listener(EndPoint, Module, Opts);
case start_listener(EndPoint, Module, Opts) of
{ok, _} ->
ets:insert(?MODULE, {EndPoint, Module, Opts});
_ ->
ok
end;
false ->
ets:insert(?MODULE, {EndPoint, Module, Opts}),
start_listener(EndPoint, Module, Opts)
case start_listener(EndPoint, Module, Opts) of
{ok, _} ->
ets:insert(?MODULE, {EndPoint, Module, Opts});
_ ->
ok
end
end
end, New).