rdb:资源解除注册,统一成单个uuid来处理 (#376)

* im wechat

* im wechat

* im add wechat_robot dingtalk_robot

* metaq 资源解除注册改为单个解除方式

Co-authored-by: alickliming <alickliming@didi.global.com>
This commit is contained in:
alick-liming 2020-11-04 22:29:37 +08:00 committed by GitHub
parent 79ae96f15d
commit 2bcb20d710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -103,19 +103,18 @@ func resourceRegister(jsonBytes []byte) error {
// 第三方系统比如RDS、Redis等资源销毁了要通知到RDB // 第三方系统比如RDS、Redis等资源销毁了要通知到RDB
func resourceUnregister(jsonBytes []byte) error { func resourceUnregister(jsonBytes []byte) error {
var uuids []string var item models.ResourceRegisterItem
err := json.Unmarshal(jsonBytes, &uuids) err := json.Unmarshal(jsonBytes, &item)
if err != nil { if err != nil {
logger.Error(err) logger.Warning(err)
// 这种错误不需要重试所以也就不需要return err了
return nil return nil
} }
if len(uuids) == 0 { if item.UUID == "" {
return nil return nil
} }
err = models.ResourceUnregister(uuids) err = models.ResourceUnregister([]string{item.UUID})
if err != nil { if err != nil {
logger.Error(err) logger.Error(err)
return err return err