diff options
| author | chrislu <chris.lu@gmail.com> | 2023-10-01 11:33:56 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-10-01 11:33:56 -0700 |
| commit | b02fdeabff4861a4fb1913de7c3104b511757da5 (patch) | |
| tree | 5ddf12ed120081bf9b9834c5be12a0b2f41c07c4 /weed/cluster | |
| parent | ebd6f96d35b54adcf67f0353bff944a36a5c5f32 (diff) | |
| download | seaweedfs-b02fdeabff4861a4fb1913de7c3104b511757da5.tar.xz seaweedfs-b02fdeabff4861a4fb1913de7c3104b511757da5.zip | |
RetryForever => RetryUntil
Diffstat (limited to 'weed/cluster')
| -rw-r--r-- | weed/cluster/lock_client.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/cluster/lock_client.go b/weed/cluster/lock_client.go index 57198c865..bb1052656 100644 --- a/weed/cluster/lock_client.go +++ b/weed/cluster/lock_client.go @@ -57,7 +57,7 @@ func (lc *LockClient) StartLock(key string, owner string) (lock *LiveLock) { lc: lc, } go func() { - util.RetryForever("create lock:"+key, func() error { + util.RetryUntil("create lock:"+key, func() error { errorMessage, err := lock.doLock(lock_manager.MaxDuration) if err != nil { glog.Infof("create lock %s: %s", key, err) @@ -98,7 +98,7 @@ func (lc *LockClient) doNewLock(key string, lockDuration time.Duration, owner st lockDuration = lc.maxLockDuration needRenewal = true } - util.RetryForever("create lock:"+key, func() error { + util.RetryUntil("create lock:"+key, func() error { errorMessage, err := lock.doLock(lockDuration) if err != nil { time.Sleep(time.Second) @@ -148,7 +148,7 @@ func (lc *LockClient) keepLock(lock *LiveLock) { select { case <-ticker: // renew the lock if lock.expireAtNs is still greater than now - util.RetryForever("keep lock:"+lock.key, func() error { + util.RetryUntil("keep lock:"+lock.key, func() error { lockDuration := time.Duration(lock.expireAtNs-time.Now().UnixNano()) * time.Nanosecond if lockDuration > lc.maxLockDuration { lockDuration = lc.maxLockDuration |
