tianxiaoliang 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_r386239567
 
 

 ##########
 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:
   不必先查再删,保持API是幂等的,我觉得挺好,你怎么想

----------------------------------------------------------------
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