Browse Source

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

This should alleviate some issues in #3850
pull/3853/head
Paweł Chmielowski 2 months ago
parent
commit
06147deccd
  1. 16
      src/ejabberd_listener.erl

16
src/ejabberd_listener.erl

@ -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).

Loading…
Cancel
Save