diff options
| author | bingoohuang <bingoo.huang@gmail.com> | 2020-05-27 13:33:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-27 13:33:00 +0800 |
| commit | 73264b952b51c5fd57e84f7e73b8667e5b09b95e (patch) | |
| tree | 48395cc0e17454bd2bcd0e89a80224dde8c7aeff /weed/shell/commands.go | |
| parent | ecdeef8c66eadbf9b4e8ac7f221444d1d92a9de0 (diff) | |
| parent | ef2b3a0801ba1a56f97460a591957942c194942d (diff) | |
| download | seaweedfs-73264b952b51c5fd57e84f7e73b8667e5b09b95e.tar.xz seaweedfs-73264b952b51c5fd57e84f7e73b8667e5b09b95e.zip | |
Merge pull request #1 from chrislusf/master
Diffstat (limited to 'weed/shell/commands.go')
| -rw-r--r-- | weed/shell/commands.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/weed/shell/commands.go b/weed/shell/commands.go index b7ca5d268..f61ed9f82 100644 --- a/weed/shell/commands.go +++ b/weed/shell/commands.go @@ -13,6 +13,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/wdclient" + "github.com/chrislusf/seaweedfs/weed/wdclient/exclusive_locks" ) type ShellOptions struct { @@ -28,7 +29,7 @@ type CommandEnv struct { env map[string]string MasterClient *wdclient.MasterClient option ShellOptions - locker *ExclusiveLocker + locker *exclusive_locks.ExclusiveLocker } type command interface { @@ -47,7 +48,7 @@ func NewCommandEnv(options ShellOptions) *CommandEnv { MasterClient: wdclient.NewMasterClient(options.GrpcDialOption, pb.AdminShellClient, "", 0, strings.Split(*options.Masters, ",")), option: options, } - ce.locker = NewExclusiveLocker(ce.MasterClient) + ce.locker = exclusive_locks.NewExclusiveLocker(ce.MasterClient) return ce } @@ -70,7 +71,7 @@ func (ce *CommandEnv) isDirectory(path string) bool { func (ce *CommandEnv) confirmIsLocked() error { - if ce.locker.isLocking { + if ce.locker.IsLocking() { return nil } |
