zhulijian1 commented on a change in pull request #127: able to get key by id
URL: https://github.com/apache/servicecomb-kie/pull/127#discussion_r398298103
##########
File path: server/service/mongo/kv/kv_service.go
##########
@@ -210,36 +208,8 @@ func (s *Service) FindKV(ctx context.Context, domain
string, project string, opt
if project == "" {
return nil, session.ErrMissingProject
}
-
- if opts.ID != "" {
- openlogging.Debug(MsgFindOneKeyByID,
openlogging.WithTags(openlogging.Tags{
- "id": opts.ID,
- "key": opts.Key,
- "labels": opts.Labels,
- }))
- return findKVByID(ctx, domain, project, opts.ID)
+ if id == "" {
+ return nil, session.ErrIDIsNil
}
-
- cur, _, err := findKV(ctx, domain, project, opts)
- if err != nil {
- return nil, err
- }
- defer cur.Close(ctx)
-
- if opts.Depth == 0 && opts.Key != "" {
- openlogging.Debug(MsgFindOneKey, openlogging.WithTags(
- map[string]interface{}{
- "key": opts.Key,
- "label": opts.Labels,
- "domain": domain,
- },
- ))
- return cursorToOneKV(ctx, cur, opts.Labels)
Review comment:
cursorToOneKV函数应该没有别处调用了吧,没的话就删了吧
----------------------------------------------------------------
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