Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
datelier committed Oct 2, 2024
1 parent b9cb6a2 commit 4d14221
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 56 deletions.
8 changes: 4 additions & 4 deletions pkg/agent/core/ngt/handler/grpc/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
}()
res, err := s.Insert(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Object_StreamLocation{
Expand All @@ -181,10 +181,10 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && span != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand Down
32 changes: 16 additions & 16 deletions pkg/agent/core/ngt/handler/grpc/linear_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
}()
res, err := s.LinearSearch(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Search_StreamResponse{
Expand All @@ -363,10 +363,10 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {

Check failure on line 367 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: sspan

Check failure on line 367 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: sspan
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand All @@ -393,10 +393,10 @@ func (s *server) StreamLinearSearchByID(
}()
res, err := s.LinearSearchByID(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Search_StreamResponse{
Expand All @@ -412,10 +412,10 @@ func (s *server) StreamLinearSearchByID(
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {

Check failure on line 416 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: sspan

Check failure on line 416 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: sspan
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand Down Expand Up @@ -453,10 +453,10 @@ func (s *server) MultiLinearSearch(
}()
r, err := s.LinearSearch(ctx, query)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
mu.Lock()
Expand All @@ -474,10 +474,10 @@ func (s *server) MultiLinearSearch(
}
wg.Wait()
if errs != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)

Check failure on line 477 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: err

Check failure on line 477 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: err
if st != nil && sspan != nil {

Check failure on line 478 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: sspan

Check failure on line 478 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: sspan
span.RecordError(err)

Check failure on line 479 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: err

Check failure on line 479 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: err
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())

Check failure on line 481 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: err

Check failure on line 481 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: err
}
return nil, err

Check failure on line 483 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: err

Check failure on line 483 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: err
Expand Down Expand Up @@ -515,10 +515,10 @@ func (s *server) MultiLinearSearchByID(
defer wg.Done()
r, err := s.LinearSearchByID(ctx, query)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
mu.Lock()
Expand All @@ -536,10 +536,10 @@ func (s *server) MultiLinearSearchByID(
}
wg.Wait()
if errs != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)

Check failure on line 539 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: err

Check failure on line 539 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: err
if st != nil && sspan != nil {

Check failure on line 540 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: sspan

Check failure on line 540 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: sspan
span.RecordError(err)

Check failure on line 541 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-stream

undefined: err

Check failure on line 541 in pkg/agent/core/ngt/handler/grpc/linear_search.go

View workflow job for this annotation

GitHub Actions / grpc-sequential

undefined: err
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions pkg/agent/core/ngt/handler/grpc/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err
}()
res, err := s.GetObject(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Object_StreamVector{
Expand All @@ -170,10 +170,10 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/agent/core/ngt/handler/grpc/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
}()
res, err := s.Remove(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Object_StreamLocation{
Expand All @@ -176,10 +176,10 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand Down Expand Up @@ -314,11 +314,11 @@ func (s *server) RemoveByTimestamp(
return true
})
if errs != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
log.Error(err)
if st != nil && span != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return nil, err
Expand Down
32 changes: 16 additions & 16 deletions pkg/agent/core/ngt/handler/grpc/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ func (s *server) StreamSearch(stream vald.Search_StreamSearchServer) (err error)
}()
res, err := s.Search(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Search_StreamResponse{
Expand All @@ -367,10 +367,10 @@ func (s *server) StreamSearch(stream vald.Search_StreamSearchServer) (err error)
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand All @@ -395,10 +395,10 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
}()
res, err := s.SearchByID(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Search_StreamResponse{
Expand All @@ -414,10 +414,10 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand Down Expand Up @@ -455,10 +455,10 @@ func (s *server) MultiSearch(
}()
r, err := s.Search(ctx, query)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
mu.Lock()
Expand All @@ -476,10 +476,10 @@ func (s *server) MultiSearch(
}
wg.Wait()
if errs != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return nil, err
Expand Down Expand Up @@ -517,10 +517,10 @@ func (s *server) MultiSearchByID(
defer wg.Done()
r, err := s.SearchByID(ctx, query)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
mu.Lock()
Expand All @@ -538,10 +538,10 @@ func (s *server) MultiSearchByID(
}
wg.Wait()
if errs != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions pkg/agent/core/ngt/handler/grpc/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
}()
res, err := s.Update(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Object_StreamLocation{
Expand All @@ -210,10 +210,10 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand Down
12 changes: 6 additions & 6 deletions pkg/agent/core/ngt/handler/grpc/upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
}()
res, err := s.Upsert(ctx, req)
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
sspan.RecordError(err)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
sspan.SetStatus(trace.StatusError, err.Error())
}
return &payload.Object_StreamLocation{
Expand All @@ -171,10 +171,10 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
}, nil
})
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && sspan != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return err
Expand Down Expand Up @@ -318,10 +318,10 @@ func (s *server) MultiUpsert(

}
if err != nil {
st, _ = status.FromError(err)
st, _ := status.FromError(err)
if st != nil && span != nil {
span.RecordError(err)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Massage())...)
span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
span.SetStatus(trace.StatusError, err.Error())
}
return nil, err
Expand Down

0 comments on commit 4d14221

Please sign in to comment.