aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/commands.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-23 13:37:31 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-23 13:37:31 -0700
commit73564e6a01770316f5ab57e7f4ba8227cedbf1dd (patch)
treed326ea0d1c169cf5f4f31df266772a41de8a83f2 /weed/shell/commands.go
parentbdc337a71938dfa0821203a79dd4a0f7e69df6ab (diff)
downloadseaweedfs-73564e6a01770316f5ab57e7f4ba8227cedbf1dd.tar.xz
seaweedfs-73564e6a01770316f5ab57e7f4ba8227cedbf1dd.zip
master: add cluster wide lock/unlock operation in weed shell
fix https://github.com/chrislusf/seaweedfs/issues/1286
Diffstat (limited to 'weed/shell/commands.go')
-rw-r--r--weed/shell/commands.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index 2faba4280..a43196b62 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -68,6 +68,16 @@ func (ce *CommandEnv) isDirectory(path string) bool {
}
+func (ce *CommandEnv) confirmIsLocked() error {
+
+ if ce.locker.isLocking {
+ return nil
+ }
+
+ return fmt.Errorf("need to lock to continue")
+
+}
+
func (ce *CommandEnv) checkDirectory(path string) error {
dir, name := util.FullPath(path).DirAndName()