|
|
@ -20,10 +20,10 @@ const (
|
|
|
|
// a Lock acquisition.
|
|
|
|
// a Lock acquisition.
|
|
|
|
DefaultLockWaitTime = 15 * time.Second
|
|
|
|
DefaultLockWaitTime = 15 * time.Second
|
|
|
|
|
|
|
|
|
|
|
|
// DefaultLockRetyTime is how long we wait after a failed lock acquisition
|
|
|
|
// DefaultLockRetryTime is how long we wait after a failed lock acquisition
|
|
|
|
// before attempting to do the lock again. This is so that once a lock-delay
|
|
|
|
// before attempting to do the lock again. This is so that once a lock-delay
|
|
|
|
// is in affect, we do not hot loop retrying the acquisition.
|
|
|
|
// is in affect, we do not hot loop retrying the acquisition.
|
|
|
|
DefaultLockRetyTime = 5 * time.Second
|
|
|
|
DefaultLockRetryTime = 5 * time.Second
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
var (
|
|
|
@ -160,7 +160,7 @@ WAIT:
|
|
|
|
// Handle the case of not getting the lock
|
|
|
|
// Handle the case of not getting the lock
|
|
|
|
if !locked {
|
|
|
|
if !locked {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
|
case <-time.After(DefaultLockRetyTime):
|
|
|
|
case <-time.After(DefaultLockRetryTime):
|
|
|
|
goto WAIT
|
|
|
|
goto WAIT
|
|
|
|
case <-stopCh:
|
|
|
|
case <-stopCh:
|
|
|
|
return nil, nil
|
|
|
|
return nil, nil
|
|
|
|