2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 00:33:57 +00:00

Merge pull request #3956 from MichaelEischer/fix-lock-refresh

lock: Use the correct duration to check for expired locks
This commit is contained in:
Michael Eischer 2022-10-07 22:58:10 +02:00 committed by GitHub
commit 83cb58b4f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,7 @@ func monitorLockRefresh(ctx context.Context, lock *restic.Lock, lockInfo *lockCo
case <-refreshed: case <-refreshed:
lastRefresh = time.Now().Unix() lastRefresh = time.Now().Unix()
case <-timer.C: case <-timer.C:
if float64(time.Now().Unix()-lastRefresh) < refreshInterval.Seconds() { if float64(time.Now().Unix()-lastRefresh) < refreshabilityTimeout.Seconds() {
// restart timer // restart timer
timer.Reset(pollDuration) timer.Reset(pollDuration)
continue continue