fix(rule): remove rules from all nodes in the cluster

This commit is contained in:
Shawn 2022-01-11 14:44:08 +08:00
parent 7dcb9567e7
commit 2a2a00e0ad
2 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ post_config_update(_, _Req, NewRules, OldRules, _AppEnvs) ->
load_rules() ->
maps_foreach(fun({Id, Rule}) ->
{ok, _} = create_rule(Rule#{id => bin(Id)})
end, emqx_conf:get([rule_engine, rules], #{})).
end, emqx:get_config([rule_engine, rules], #{})).
-spec create_rule(map()) -> {ok, rule()} | {error, term()}.
create_rule(Params = #{id := RuleId}) when is_binary(RuleId) ->

View File

@ -246,7 +246,7 @@ param_path_id() ->
'/rules/:id'(delete, #{bindings := #{id := Id}}) ->
ConfPath = emqx_rule_engine:config_key_path() ++ [Id],
case emqx:remove_config(ConfPath, #{}) of
case emqx_conf:remove(ConfPath, #{}) of
{ok, _} -> {204};
{error, Reason} ->
?SLOG(error, #{msg => "delete_rule_failed",