Browse Source

优化distlock的功能

gitlink
Sydonian 2 years ago
parent
commit
831103b6b9
4 changed files with 1 additions and 10 deletions
  1. +1
    -4
      client/internal/cmdline/distlock.go
  2. +0
    -2
      common/assets/confs/agent.config.json
  3. +0
    -2
      common/assets/confs/client.config.json
  4. +0
    -2
      common/assets/confs/scanner.config.json

+ 1
- 4
client/internal/cmdline/distlock.go View File

@@ -6,7 +6,6 @@ import (

"github.com/samber/lo"
"gitlink.org.cn/cloudream/common/pkgs/distlock"
"gitlink.org.cn/cloudream/common/pkgs/distlock/service"
"gitlink.org.cn/cloudream/storage/common/pkgs/distlock/lockprovider"
)

@@ -22,9 +21,7 @@ func DistLockLock(ctx CommandContext, lockData []string) error {
req.Locks = append(req.Locks, l)
}

reqID, err := ctx.Cmdline.Svc.DistLock.Acquire(req, service.AcquireOption{
RetryTimeMs: 5000,
})
reqID, err := ctx.Cmdline.Svc.DistLock.Acquire(req)
if err != nil {
return fmt.Errorf("acquire locks failed, err: %w", err)
}


+ 0
- 2
common/assets/confs/agent.config.json View File

@@ -31,9 +31,7 @@
"etcdAddress": "127.0.0.1:2379",
"etcdUsername": "",
"etcdPassword": "",
"etcdLockAcquireTimeoutMs": 5000,
"etcdLockLeaseTimeSec": 5,
"lockRequestLeaseTimeSec": 5,
"submitLockRequestWithoutLease": true
}
}

+ 0
- 2
common/assets/confs/client.config.json View File

@@ -23,9 +23,7 @@
"etcdAddress": "127.0.0.1:2379",
"etcdUsername": "",
"etcdPassword": "",
"etcdLockAcquireTimeoutMs": 5000,
"etcdLockLeaseTimeSec": 5,
"lockRequestLeaseTimeSec": 5,
"submitLockRequestWithoutLease": true
}
}

+ 0
- 2
common/assets/confs/scanner.config.json View File

@@ -23,9 +23,7 @@
"etcdAddress": "127.0.0.1:2379",
"etcdUsername": "",
"etcdPassword": "",
"etcdLockAcquireTimeoutMs": 5000,
"etcdLockLeaseTimeSec": 5,
"lockRequestLeaseTimeSec": 5,
"submitLockRequestWithoutLease": true
}
}

Loading…
Cancel
Save