aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_delete_empty.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_volume_delete_empty.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_volume_delete_empty.go')
-rw-r--r--weed/shell/command_volume_delete_empty.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/shell/command_volume_delete_empty.go b/weed/shell/command_volume_delete_empty.go
index a20ac2f7e..fdc4fcf6a 100644
--- a/weed/shell/command_volume_delete_empty.go
+++ b/weed/shell/command_volume_delete_empty.go
@@ -33,10 +33,6 @@ func (c *commandVolumeDeleteEmpty) Help() string {
func (c *commandVolumeDeleteEmpty) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
- if err = commandEnv.confirmIsLocked(); err != nil {
- return
- }
-
volDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
quietPeriod := volDeleteCommand.Duration("quietFor", 24*time.Hour, "select empty volumes with no recent writes, avoid newly created ones")
applyBalancing := volDeleteCommand.Bool("force", false, "apply to delete empty volumes")
@@ -44,6 +40,10 @@ func (c *commandVolumeDeleteEmpty) Do(args []string, commandEnv *CommandEnv, wri
return nil
}
+ if err = commandEnv.confirmIsLocked(); err != nil {
+ return
+ }
+
// collect topology information
topologyInfo, _, err := collectTopologyInfo(commandEnv)
if err != nil {