diff options
Diffstat (limited to 'weed/shell/commands.go')
| -rw-r--r-- | weed/shell/commands.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/shell/commands.go b/weed/shell/commands.go index 582ee560d..dbbd86f0e 100644 --- a/weed/shell/commands.go +++ b/weed/shell/commands.go @@ -35,6 +35,7 @@ type CommandEnv struct { MasterClient *wdclient.MasterClient option *ShellOptions locker *exclusive_locks.ExclusiveLocker + noLock bool } func NewCommandEnv(options *ShellOptions) *CommandEnv { @@ -42,6 +43,7 @@ func NewCommandEnv(options *ShellOptions) *CommandEnv { env: make(map[string]string), MasterClient: wdclient.NewMasterClient(options.GrpcDialOption, *options.FilerGroup, pb.AdminShellClient, "", "", "", *pb.ServerAddresses(*options.Masters).ToServiceDiscovery()), option: options, + noLock: false, } ce.locker = exclusive_locks.NewExclusiveLocker(ce.MasterClient, "shell") return ce @@ -79,6 +81,9 @@ func (ce *CommandEnv) isLocked() bool { if ce == nil { return true } + if ce.noLock { + return false + } return ce.locker.IsLocked() } |
