Skip to content

Commit

Permalink
return uuid when exits rpc called (#1709)
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 authored Jun 22, 2022
1 parent 417abed commit a41df5e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/agent/core/ngt/handler/grpc/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package grpc
import (
"context"
"fmt"
"strconv"

"github.com/vdaas/vald/apis/grpc/v1/payload"
"github.com/vdaas/vald/apis/grpc/v1/vald"
Expand Down Expand Up @@ -66,8 +65,7 @@ func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *paylo
log.Warn(err)
return nil, err
}
oid, ok := s.ngt.Exists(uuid)
if !ok {
if _, ok := s.ngt.Exists(uuid); !ok {
err = errors.ErrObjectIDNotFound(uid.GetId())
err = status.WrapWithNotFound(fmt.Sprintf("Exists API meta %s's uuid not found", uid.GetId()), err,
&errdetails.RequestInfo{
Expand All @@ -84,9 +82,7 @@ func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *paylo
}
return nil, err
}
return &payload.Object_ID{
Id: strconv.Itoa(int(oid)),
}, nil
return uid, nil
}

func (s *server) GetObject(ctx context.Context, id *payload.Object_VectorRequest) (res *payload.Object_Vector, err error) {
Expand Down

0 comments on commit a41df5e

Please sign in to comment.