Merge pull request #766 from Allda/lock_timeout

Fix: lock updater - return correct bool value
This commit is contained in:
Jimmy Zelinskie 2019-04-11 13:44:10 -04:00 committed by GitHub
commit d79827690c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -360,7 +360,7 @@ func AcquireLock(datastore Datastore, name, owner string, duration time.Duration
// ExtendLock extends the duration of an existing global lock for the given
// duration.
func ExtendLock(ds Datastore, name, whoami string, desiredLockDuration time.Duration) (extended bool, expiration time.Time) {
func ExtendLock(ds Datastore, name, whoami string, desiredLockDuration time.Duration) (bool, time.Time) {
tx, err := ds.Begin()
if err != nil {
return false, time.Time{}
@ -374,7 +374,7 @@ func ExtendLock(ds Datastore, name, whoami string, desiredLockDuration time.Dura
if locked {
if err := tx.Commit(); err == nil {
return
return locked, expiration
}
}