From 054623bd560df28606fe23a807dc05bd533c75d0 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Fri, 30 Jul 2021 15:12:48 +0800 Subject: [PATCH] fix(authz): update the post_config_update callback --- apps/emqx/src/emqx_config_handler.erl | 4 ++-- apps/emqx_authz/src/emqx_authz.erl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/emqx/src/emqx_config_handler.erl b/apps/emqx/src/emqx_config_handler.erl index b57c561cf..9a830bf4d 100644 --- a/apps/emqx/src/emqx_config_handler.erl +++ b/apps/emqx/src/emqx_config_handler.erl @@ -51,7 +51,7 @@ emqx_config:update_request(). -callback post_config_update(emqx_config:update_request(), emqx_config:config(), - emqx_config:config()) -> ok | {error, term()}. + emqx_config:config()) -> any(). -type state() :: #{ handlers := handlers(), @@ -94,7 +94,7 @@ handle_call({change_config, SchemaModule, ConfKeyPath, UpdateReq}, _From, {NewRawConf, OverrideConf} = process_upadate_request(ConfKeyPath, OldRawConf, Handlers, UpdateReq), {AppEnvs, CheckedConf} = emqx_config:check_config(SchemaModule, NewRawConf), - do_post_config_update(ConfKeyPath, Handlers, OldConf, CheckedConf, UpdateReq), + _ = do_post_config_update(ConfKeyPath, Handlers, OldConf, CheckedConf, UpdateReq), emqx_config:save_configs(AppEnvs, CheckedConf, NewRawConf, OverrideConf) catch Error:Reason:ST -> ?LOG(error, "change_config failed: ~p", [{Error, Reason, ST}]), diff --git a/apps/emqx_authz/src/emqx_authz.erl b/apps/emqx_authz/src/emqx_authz.erl index 940c1ec37..51600ea81 100644 --- a/apps/emqx_authz/src/emqx_authz.erl +++ b/apps/emqx_authz/src/emqx_authz.erl @@ -31,7 +31,7 @@ , match/4 ]). --export([post_config_update/2, pre_config_update/2]). +-export([post_config_update/3, pre_config_update/2]). -define(CONF_KEY_PATH, [authorization, rules]). @@ -63,10 +63,10 @@ pre_config_update({_, NewConf}, _OldConf) -> false -> [NewConf] end. -post_config_update(undefined, _OldConf) -> +post_config_update(_, undefined, _OldConf) -> %_ = [release_rules(Rule) || Rule <- OldConf], ok; -post_config_update(NewRules, _OldConf) -> +post_config_update(_, NewRules, _OldConf) -> %_ = [release_rules(Rule) || Rule <- OldConf], InitedRules = [init_rule(Rule) || Rule <- NewRules], Action = find_action_in_hooks(),