Skip to content

Commit

Permalink
Fix lint issue
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Oct 9, 2024
1 parent 980f560 commit c2898f4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions states/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/milvus-io/birdwatcher/framework"
"github.com/milvus-io/birdwatcher/models"
commonpbv2 "github.com/milvus-io/birdwatcher/proto/v2.2/commonpb"
"github.com/milvus-io/birdwatcher/proto/v2.2/querypb"
querypbv2 "github.com/milvus-io/birdwatcher/proto/v2.2/querypb"
"github.com/milvus-io/birdwatcher/states/etcd/common"
etcdversion "github.com/milvus-io/birdwatcher/states/etcd/version"
Expand All @@ -30,7 +29,6 @@ func (s *InstanceState) GetDistributionCommand(ctx context.Context, p *GetDistri
segments, err := common.ListSegmentsVersion(ctx, s.client, s.basePath, etcdversion.GetVersion(), func(s *models.Segment) bool {
return p.CollectionID == 0 || p.CollectionID == s.CollectionID
})

if err != nil {
return err
}
Expand Down Expand Up @@ -63,7 +61,7 @@ func (s *InstanceState) GetDistributionCommand(ctx context.Context, p *GetDistri
grpc.WithBlock(),
}

dialCtx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
dialCtx, cancel := context.WithTimeout(ctx, 2*time.Second)
conn, err := grpc.DialContext(dialCtx, session.Address, opts...)
cancel()
// ignore bad session
Expand All @@ -83,7 +81,7 @@ func (s *InstanceState) GetDistributionCommand(ctx context.Context, p *GetDistri
close(clientCh)

type distResponse struct {
resp *querypb.GetDataDistributionResponse
resp *querypbv2.GetDataDistributionResponse
err error
id int64
}
Expand Down Expand Up @@ -118,7 +116,7 @@ func (s *InstanceState) GetDistributionCommand(ctx context.Context, p *GetDistri
fmt.Println("===========")
fmt.Printf("ServerID %d\n", result.id)
if result.err != nil {
fmt.Println("Error fetching distribution:", err.Error())
fmt.Println("Error fetching distribution:", result.err.Error())
continue
}
resp := result.resp
Expand Down

0 comments on commit c2898f4

Please sign in to comment.