fix(authz): Fix no match error after deleting a source

This commit is contained in:
zhanghongtong 2021-10-09 11:41:27 +08:00 committed by Rory Z
parent 7c28a3f6c1
commit 24b0fccba9
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ do_post_update({{delete, Type}, _Source}, _NewSources) ->
OldInitedSources = lookup(), OldInitedSources = lookup(),
{OldSource, Front, Rear} = take(Type, OldInitedSources), {OldSource, Front, Rear} = take(Type, OldInitedSources),
ok = ensure_resource_deleted(OldSource), ok = ensure_resource_deleted(OldSource),
ok = emqx_hooks:put('client.authorize', {?MODULE, authorize, Front ++ Rear}, -1), ok = emqx_hooks:put('client.authorize', {?MODULE, authorize, [Front ++ Rear]}, -1),
ok = emqx_authz_cache:drain_cache(); ok = emqx_authz_cache:drain_cache();
do_post_update(_, NewSources) -> do_post_update(_, NewSources) ->
%% overwrite the entire config! %% overwrite the entire config!