aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/commands.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-05-26 00:03:31 -0700
committerChris Lu <chris.lu@gmail.com>2020-05-26 00:03:31 -0700
commit5d3ec22975637b0620acf26702efe45888c74e77 (patch)
tree78bd243f5527b455cf089969d1a594a08cfdcc27 /weed/shell/commands.go
parentd4235afe4daabc1bd15957c6bcd6fd442bd2f2a6 (diff)
downloadseaweedfs-5d3ec22975637b0620acf26702efe45888c74e77.tar.xz
seaweedfs-5d3ec22975637b0620acf26702efe45888c74e77.zip
refactoring
Diffstat (limited to 'weed/shell/commands.go')
-rw-r--r--weed/shell/commands.go7
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
}