refactor(cli): simplify ACL cache CLI logging
This commit is contained in:
parent
f6ca64c76d
commit
91180595d0
|
@ -577,21 +577,11 @@ data(_) ->
|
||||||
%% @doc acl Command
|
%% @doc acl Command
|
||||||
|
|
||||||
acl(["cache-clean", "node", Node]) ->
|
acl(["cache-clean", "node", Node]) ->
|
||||||
case for_node(fun emqx_mgmt:clean_acl_cache_all/1, Node) of
|
with_log(fun() -> for_node(fun emqx_mgmt:clean_acl_cache_all/1, Node) end,
|
||||||
ok ->
|
"ACL cache drain start");
|
||||||
emqx_ctl:print("ACL cache drain started on node ~s.~n", [Node]);
|
|
||||||
{error, Reason} ->
|
|
||||||
emqx_ctl:print("ACL drain failed on node ~s: ~0p.~n", [Node, Reason])
|
|
||||||
end;
|
|
||||||
|
|
||||||
acl(["cache-clean", "all"]) ->
|
acl(["cache-clean", "all"]) ->
|
||||||
case emqx_mgmt:clean_acl_cache_all() of
|
with_log(fun emqx_mgmt:clean_acl_cache_all/1,
|
||||||
ok ->
|
"ACL cache drain start");
|
||||||
emqx_ctl:print("Started ACL cache drain in all nodes~n");
|
|
||||||
{error, Reason} ->
|
|
||||||
emqx_ctl:print("ACL cache-clean failed: ~p.~n", [Reason])
|
|
||||||
end;
|
|
||||||
|
|
||||||
acl(["cache-clean", ClientId]) ->
|
acl(["cache-clean", ClientId]) ->
|
||||||
emqx_mgmt:clean_acl_cache(ClientId);
|
emqx_mgmt:clean_acl_cache(ClientId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue