Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby committed Feb 18, 2024
1 parent 8c647fd commit 476b680
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions states/etcd/download/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ func PullGlobalDistributionDetails(cli clientv3.KV, basePath string) *cobra.Comm
return err
}

fileName, err := cmd.Flags().GetString("file")
if err != nil {
return err
}
f, err := os.Create(fileName)
if err != nil {
return err
}

defer f.Close()

w := csv.NewWriter(f)
defer w.Flush()

for _, session := range sessions {
opts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
Expand Down Expand Up @@ -77,19 +91,6 @@ func PullGlobalDistributionDetails(cli clientv3.KV, basePath string) *cobra.Comm
return err
}

fileName, err := cmd.Flags().GetString("file")
if err != nil {
return err
}
f, err := os.Create(fileName)
if err != nil {
return err
}

defer f.Close()
w := csv.NewWriter(f)
defer w.Flush()

for _, segment := range segments {
// serverID,collectionID,partitionID,segmentID,channelName,rowNum,state
content := make([]string, 0)
Expand Down

0 comments on commit 476b680

Please sign in to comment.