Merge pull request #7552 from EMQ-YangM/fix_kafka_resource_update

fix: delete a resource before updating it
This commit is contained in:
Xinyu Liu 2022-04-08 13:46:56 +08:00 committed by GitHub
commit e317043109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,