diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-02-25 22:23:59 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-02-25 22:23:59 -0800 |
| commit | 97ab8a1976f3ba056af8d5b630dcb43006425b51 (patch) | |
| tree | f98588240db017bf7d372b0f216355892cf868e8 /weed/shell/command_ec_balance.go | |
| parent | ca4ca1ae6f87c6fcbf9c486722f36b4f07166187 (diff) | |
| download | seaweedfs-97ab8a1976f3ba056af8d5b630dcb43006425b51.tar.xz seaweedfs-97ab8a1976f3ba056af8d5b630dcb43006425b51.zip | |
remove ctx if possible
Diffstat (limited to 'weed/shell/command_ec_balance.go')
| -rw-r--r-- | weed/shell/command_ec_balance.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go index 7230a869f..299d44fed 100644 --- a/weed/shell/command_ec_balance.go +++ b/weed/shell/command_ec_balance.go @@ -1,7 +1,6 @@ package shell import ( - "context" "flag" "fmt" "io" @@ -160,11 +159,9 @@ func collectRacks(allEcNodes []*EcNode) map[RackId]*EcRack { func balanceEcVolumes(commandEnv *CommandEnv, collection string, allEcNodes []*EcNode, racks map[RackId]*EcRack, applyBalancing bool) error { - ctx := context.Background() - fmt.Printf("balanceEcVolumes %s\n", collection) - if err := deleteDuplicatedEcShards(ctx, commandEnv, allEcNodes, collection, applyBalancing); err != nil { + if err := deleteDuplicatedEcShards(commandEnv, allEcNodes, collection, applyBalancing); err != nil { return fmt.Errorf("delete duplicated collection %s ec shards: %v", collection, err) } @@ -179,7 +176,7 @@ func balanceEcVolumes(commandEnv *CommandEnv, collection string, allEcNodes []*E return nil } -func deleteDuplicatedEcShards(ctx context.Context, commandEnv *CommandEnv, allEcNodes []*EcNode, collection string, applyBalancing bool) error { +func deleteDuplicatedEcShards(commandEnv *CommandEnv, allEcNodes []*EcNode, collection string, applyBalancing bool) error { // vid => []ecNode vidLocations := collectVolumeIdToEcNodes(allEcNodes) // deduplicate ec shards |
