From 2378fd15d4dac1b6ac66e8f6c857e85a0cb3d6ec Mon Sep 17 00:00:00 2001 From: datelier <57349093+datelier@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:43:08 +0900 Subject: [PATCH] fix typo --- pkg/agent/core/ngt/handler/grpc/linear_search.go | 12 ++++++------ pkg/agent/core/ngt/handler/grpc/remove.go | 8 ++++---- pkg/agent/core/ngt/handler/grpc/search.go | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/agent/core/ngt/handler/grpc/linear_search.go b/pkg/agent/core/ngt/handler/grpc/linear_search.go index ec60589d78..28bb156750 100644 --- a/pkg/agent/core/ngt/handler/grpc/linear_search.go +++ b/pkg/agent/core/ngt/handler/grpc/linear_search.go @@ -474,11 +474,11 @@ func (s *server) MultiLinearSearch( } wg.Wait() if errs != nil { - st, _ := status.FromError(err) + st, _ := status.FromError(errs) if st != nil && span != nil { - span.RecordError(err) + span.RecordError(errs) span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...) - span.SetStatus(trace.StatusError, err.Error()) + span.SetStatus(trace.StatusError, errs.Error()) } return nil, err } @@ -536,11 +536,11 @@ func (s *server) MultiLinearSearchByID( } wg.Wait() if errs != nil { - st, _ := status.FromError(err) + st, _ := status.FromError(errs) if st != nil && span != nil { - span.RecordError(err) + span.RecordError(errs) span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...) - span.SetStatus(trace.StatusError, err.Error()) + span.SetStatus(trace.StatusError, errs.Error()) } return nil, err } diff --git a/pkg/agent/core/ngt/handler/grpc/remove.go b/pkg/agent/core/ngt/handler/grpc/remove.go index 2b357f3ee0..00baf1e216 100644 --- a/pkg/agent/core/ngt/handler/grpc/remove.go +++ b/pkg/agent/core/ngt/handler/grpc/remove.go @@ -314,12 +314,12 @@ func (s *server) RemoveByTimestamp( return true }) if errs != nil { - st, _ := status.FromError(err) - log.Error(err) + st, _ := status.FromError(errs) + log.Error(errs) if st != nil && span != nil { - span.RecordError(err) + span.RecordError(errs) span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...) - span.SetStatus(trace.StatusError, err.Error()) + span.SetStatus(trace.StatusError, errs.Error()) } return nil, err } diff --git a/pkg/agent/core/ngt/handler/grpc/search.go b/pkg/agent/core/ngt/handler/grpc/search.go index aa4a445941..33699bbb9d 100644 --- a/pkg/agent/core/ngt/handler/grpc/search.go +++ b/pkg/agent/core/ngt/handler/grpc/search.go @@ -476,11 +476,11 @@ func (s *server) MultiSearch( } wg.Wait() if errs != nil { - st, _ := status.FromError(err) + st, _ := status.FromError(errs) if st != nil && span != nil { - span.RecordError(err) + span.RecordError(errs) span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...) - span.SetStatus(trace.StatusError, err.Error()) + span.SetStatus(trace.StatusError, errs.Error()) } return nil, err } @@ -538,11 +538,11 @@ func (s *server) MultiSearchByID( } wg.Wait() if errs != nil { - st, _ := status.FromError(err) + st, _ := status.FromError(errs) if st != nil && span != nil { - span.RecordError(err) + span.RecordError(errs) span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...) - span.SetStatus(trace.StatusError, err.Error()) + span.SetStatus(trace.StatusError, errs.Error()) } return nil, err }