26
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Fix support to restart module with live options in WebAdmin

This commit is contained in:
Badlop 2019-02-06 13:30:30 +01:00
parent 7074a39ff3
commit c41c5b2185

View File

@ -2381,10 +2381,13 @@ node_modules_parse_query(Host, Node, Modules, Query) ->
{ok, Tokens, _} = {ok, Tokens, _} =
erl_scan:string(binary_to_list(<<SOpts/binary, ".">>)), erl_scan:string(binary_to_list(<<SOpts/binary, ".">>)),
{ok, Opts} = erl_parse:parse_term(Tokens), {ok, Opts} = erl_parse:parse_term(Tokens),
NewMods = lists:keystore(Module, 1, ejabberd_config:get_option(modules), {Module, Opts}),
ejabberd_cluster:call(Node, gen_mod, stop_module, ejabberd_cluster:call(Node, gen_mod, stop_module,
[Host, Module]), [Host, Module]),
ejabberd_cluster:call(Node, ejabberd_config, add_option,
[modules, NewMods]),
ejabberd_cluster:call(Node, gen_mod, start_module, ejabberd_cluster:call(Node, gen_mod, start_module,
[Host, Module, Opts]), [Host, Module]),
throw(submitted); throw(submitted);
_ -> _ ->
case lists:keysearch(<<"stop", SModule/binary>>, case lists:keysearch(<<"stop", SModule/binary>>,