master: add cluster wide lock/unlock operation in weed shell

fix https://github.com/chrislusf/seaweedfs/issues/1286
This commit is contained in:
Chris Lu
2020-04-23 13:37:31 -07:00
parent bdc337a719
commit 73564e6a01
18 changed files with 76 additions and 1 deletions

View File

@@ -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()