25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Improve reload_config admin command

This commit is contained in:
Evgeniy Khramtsov 2017-02-23 11:14:49 +03:00
parent 7d68112265
commit a3ea6e7723
2 changed files with 4 additions and 3 deletions

View File

@ -174,7 +174,7 @@ get_commands_spec() ->
args = [],
result = {vhosts, {list, {vhost, string}}}},
#ejabberd_commands{name = reload_config, tags = [server],
desc = "Reload config file in memory (only affects ACL and Access)",
desc = "Reload config file in memory",
module = ?MODULE, function = reload_config,
args = [],
result = {res, rescode}},
@ -473,8 +473,8 @@ registered_vhosts() ->
reload_config() ->
ejabberd_config:reload_file(),
acl:load_from_config(),
shaper:load_from_config(),
%% TODO: Move this to ejabberd_access_permissions.erl and put on hook
%% This requires ejabberd_access_permissions to start after ejabberd_hooks
ejabberd_access_permissions:invalidate().
%%%

View File

@ -55,6 +55,7 @@ start() ->
{local_content, true},
{attributes, record_info(fields, shaper)}]),
mnesia:add_table_copy(shaper, node(), ram_copies),
ejabberd_hooks:add(config_reloaded, ?MODULE, load_from_config, 20),
load_from_config(),
ok.