1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 15:57:07 +00:00

lock: Use the correct duration to check for expired locks

This commit is contained in:
Michael Eischer 2022-10-07 22:39:53 +02:00
parent 8b7c952f17
commit 7c5d63a794

View file

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