From da109f68074ee80912c431cd64dd516408e97ec6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 2 Mar 2026 13:29:25 -0800 Subject: [PATCH] shell: allow bypassing lock checks --- weed/shell/commands.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/weed/shell/commands.go b/weed/shell/commands.go index d34204878..72fcc45ff 100644 --- a/weed/shell/commands.go +++ b/weed/shell/commands.go @@ -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