mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-03 18:47:41 +01:00
shell: allow bypassing lock checks
This commit is contained in:
1 parent
1e0003e283
commit
da109f6807
1 file changed
+10
@@ -71,6 +71,9 @@ func (ce *CommandEnv) isDirectory(path string) bool {
|
||||
|
||||
func (ce *CommandEnv) confirmIsLocked(args []string) error {
|
||||
|
||||
if ce.noLock {
|
||||
return nil
|
||||
}
|
||||
if ce.locker.IsLocked() {
|
||||
return nil
|
||||
}
|
||||
@@ -80,6 +83,13 @@ func (ce *CommandEnv) confirmIsLocked(args []string) error {
|
||||
|
||||
}
|
||||
|
||||
func (ce *CommandEnv) SetNoLock(noLock bool) {
|
||||
if ce == nil {
|
||||
return
|
||||
}
|
||||
ce.noLock = noLock
|
||||
}
|
||||
|
||||
func (ce *CommandEnv) isLocked() bool {
|
||||
if ce == nil {
|
||||
return true
|
||||
|
||||
Reference in new issue
Block a user