mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-09 11:36:41 +08:00
add exclusive lock library on shell
This commit is contained in:
@@ -28,6 +28,7 @@ type CommandEnv struct {
|
||||
env map[string]string
|
||||
MasterClient *wdclient.MasterClient
|
||||
option ShellOptions
|
||||
locker *ExclusiveLocker
|
||||
}
|
||||
|
||||
type command interface {
|
||||
@@ -41,11 +42,13 @@ var (
|
||||
)
|
||||
|
||||
func NewCommandEnv(options ShellOptions) *CommandEnv {
|
||||
return &CommandEnv{
|
||||
ce := &CommandEnv{
|
||||
env: make(map[string]string),
|
||||
MasterClient: wdclient.NewMasterClient(options.GrpcDialOption, pb.AdminShellClient, "", 0, strings.Split(*options.Masters, ",")),
|
||||
option: options,
|
||||
}
|
||||
ce.locker = NewExclusiveLocker(ce.MasterClient)
|
||||
return ce
|
||||
}
|
||||
|
||||
func (ce *CommandEnv) parseUrl(input string) (path string, err error) {
|
||||
|
||||
Reference in New Issue
Block a user