aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_balance.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-09-13 22:13:34 -0700
committerChris Lu <chris.lu@gmail.com>2021-09-13 22:13:34 -0700
commit119d5908dd52b159c275bad10007daaf62188df0 (patch)
tree3467183cb6cc5c832fedd1519fe3dcb377aa5f25 /weed/shell/command_ec_balance.go
parent7504be58f9fc7683869e164bc710b3e83da12e2f (diff)
downloadseaweedfs-119d5908dd52b159c275bad10007daaf62188df0.tar.xz
seaweedfs-119d5908dd52b159c275bad10007daaf62188df0.zip
shell: do not need to lock to see volume -h
Diffstat (limited to 'weed/shell/command_ec_balance.go')
-rw-r--r--weed/shell/command_ec_balance.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go
index d15c69d43..e5438b9c7 100644
--- a/weed/shell/command_ec_balance.go
+++ b/weed/shell/command_ec_balance.go
@@ -100,10 +100,6 @@ func (c *commandEcBalance) Help() string {
func (c *commandEcBalance) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
- if err = commandEnv.confirmIsLocked(); err != nil {
- return
- }
-
balanceCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
collection := balanceCommand.String("collection", "EACH_COLLECTION", "collection name, or \"EACH_COLLECTION\" for each collection")
dc := balanceCommand.String("dataCenter", "", "only apply the balancing for this dataCenter")
@@ -112,6 +108,10 @@ func (c *commandEcBalance) Do(args []string, commandEnv *CommandEnv, writer io.W
return nil
}
+ if err = commandEnv.confirmIsLocked(); err != nil {
+ return
+ }
+
// collect all ec nodes
allEcNodes, totalFreeEcSlots, err := collectEcNodes(commandEnv, *dc)
if err != nil {