From a7ba678463ae47add132b7ff4f0c829ed5cf8c25 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Tue, 8 Mar 2022 09:05:23 +0800 Subject: [PATCH] fix: elvis warning --- apps/emqx/src/emqx_config_handler.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/emqx/src/emqx_config_handler.erl b/apps/emqx/src/emqx_config_handler.erl index 153598877..af99cb732 100644 --- a/apps/emqx/src/emqx_config_handler.erl +++ b/apps/emqx/src/emqx_config_handler.erl @@ -76,7 +76,8 @@ update_config(SchemaModule, ConfKeyPath, UpdateArgs) -> AtomKeyPath = [atom(Key) || Key <- ConfKeyPath], gen_server:call(?MODULE, {change_config, SchemaModule, AtomKeyPath, UpdateArgs}, infinity). --spec add_handler(emqx_config:config_key_path(), handler_name()) -> ok | {error, {conflict, list()}}. +-spec add_handler(emqx_config:config_key_path(), handler_name()) -> + ok | {error, {conflict, list()}}. add_handler(ConfKeyPath, HandlerName) -> assert_callback_function(HandlerName), gen_server:call(?MODULE, {add_handler, ConfKeyPath, HandlerName}). @@ -149,6 +150,10 @@ deep_put_handler([Key | KeyPath], Handlers, Mod) -> end. %% Make sure that Specify Key and ?WKEY cannot be on the same level. +%% +%% [k1, ?, ?], [k1, ?], [k1] is allow. +%% [K1, ?, k2], [k1, ?, k3] is allow. +%% [k1, ?, ?], [k1, ?, k2] is not allow. check_handler_conflict(Handlers) -> Keys = filter_top_level_handlers(Handlers), case lists:member(?WKEY, Keys) of