Merge pull request #7552 from EMQ-YangM/fix_kafka_resource_update
fix: delete a resource before updating it
This commit is contained in:
commit
e317043109
|
@ -297,6 +297,7 @@ do_check_and_update_resource(#{id := Id, type := Type, description := NewDescrip
|
||||||
Config = emqx_rule_validator:validate_params(NewConfig, ParamSpec),
|
Config = emqx_rule_validator:validate_params(NewConfig, ParamSpec),
|
||||||
case test_resource(#{type => Type, config => NewConfig}) of
|
case test_resource(#{type => Type, config => NewConfig}) of
|
||||||
ok ->
|
ok ->
|
||||||
|
delete_resource(Id),
|
||||||
_ = ?CLUSTER_CALL(init_resource, [Module, Create, Id, Config]),
|
_ = ?CLUSTER_CALL(init_resource, [Module, Create, Id, Config]),
|
||||||
emqx_rule_registry:add_resource(#resource{
|
emqx_rule_registry:add_resource(#resource{
|
||||||
id = Id,
|
id = Id,
|
||||||
|
|
Loading…
Reference in New Issue