Skip to content

Commit

Permalink
Fix log print (milvus-io#19204)
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>

Signed-off-by: sunby <[email protected]>
Co-authored-by: sunby <[email protected]>
  • Loading branch information
sunby and sunby authored Sep 16, 2022
1 parent 58d3a49 commit 3998752
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions internal/proxy/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,8 @@ func (cpt *createPartitionTask) PreExecute(ctx context.Context) error {

func (cpt *createPartitionTask) Execute(ctx context.Context) (err error) {
cpt.result, err = cpt.rootCoord.CreatePartition(ctx, cpt.CreatePartitionRequest)
if cpt.result == nil {
return errors.New("get collection statistics resp is nil")
if err != nil {
return err
}
if cpt.result.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(cpt.result.Reason)
Expand Down Expand Up @@ -879,8 +879,8 @@ func (dpt *dropPartitionTask) PreExecute(ctx context.Context) error {

func (dpt *dropPartitionTask) Execute(ctx context.Context) (err error) {
dpt.result, err = dpt.rootCoord.DropPartition(ctx, dpt.DropPartitionRequest)
if dpt.result == nil {
return errors.New("get collection statistics resp is nil")
if err != nil {
return err
}
if dpt.result.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(dpt.result.Reason)
Expand Down Expand Up @@ -955,8 +955,8 @@ func (hpt *hasPartitionTask) PreExecute(ctx context.Context) error {

func (hpt *hasPartitionTask) Execute(ctx context.Context) (err error) {
hpt.result, err = hpt.rootCoord.HasPartition(ctx, hpt.HasPartitionRequest)
if hpt.result == nil {
return errors.New("get collection statistics resp is nil")
if err != nil {
return err
}
if hpt.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(hpt.result.Status.Reason)
Expand Down Expand Up @@ -1334,8 +1334,8 @@ func (cit *createIndexTask) Execute(ctx context.Context) error {
}
cit.result, err = cit.indexCoord.CreateIndex(ctx, req)
//cit.result, err = cit.rootCoord.CreateIndex(ctx, cit.CreateIndexRequest)
if cit.result == nil {
return errors.New("get collection statistics resp is nil")
if err != nil {
return err
}
if cit.result.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(cit.result.Reason)
Expand Down
6 changes: 3 additions & 3 deletions internal/proxy/task_statistic.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ func (g *getCollectionStatisticsTask) Execute(ctx context.Context) error {
CollectionID: collID,
}

result, _ := g.dataCoord.GetCollectionStatistics(ctx, req)
if result == nil {
return errors.New("get collection statistics resp is nil")
result, err := g.dataCoord.GetCollectionStatistics(ctx, req)
if err != nil {
return err
}
if result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(result.Status.Reason)
Expand Down

0 comments on commit 3998752

Please sign in to comment.