zhulijian1 commented on a change in pull request #106: #102 increase revision 
counter when delete key
URL: https://github.com/apache/servicecomb-kie/pull/106#discussion_r386245940
 
 

 ##########
 File path: server/resource/v1/kv_resource.go
 ##########
 @@ -326,7 +326,17 @@ func (r *KVResource) Delete(context *restful.Context) {
                WriteErrResponse(context, http.StatusBadRequest, 
common.ErrKvIDMustNotEmpty, common.ContentTypeText)
                return
        }
-       err := service.KVService.Delete(context.Ctx, kvID, domain.(string), 
project)
+       result, err := service.KVService.FindKV(context.Ctx, domain.(string), 
project,
+               service.WithID(kvID))
+       if err != nil && err != service.ErrKeyNotExists {
 
 Review comment:
   
主要是要Publish一个事件就必须先查一下,传进来的是id,构造KVChangeEvent的时候不知道key和label。既然查都查了,没查到就返回了,我ErrKeyNotExists的错误也排除了,删除时查不到不会出错

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to