fix: delete a resource before updating it

This commit is contained in:
EMQ-YangM 2022-04-08 11:46:10 +08:00
parent 70e29b08e6
commit 8530ecec4d
1 changed files with 1 additions and 0 deletions

View File

@ -297,6 +297,7 @@ do_check_and_update_resource(#{id := Id, type := Type, description := NewDescrip
Config = emqx_rule_validator:validate_params(NewConfig, ParamSpec),
case test_resource(#{type => Type, config => NewConfig}) of
ok ->
delete_resource(Id),
_ = ?CLUSTER_CALL(init_resource, [Module, Create, Id, Config]),
emqx_rule_registry:add_resource(#resource{
id = Id,