2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-29 05:13:09 +00:00

Merge pull request #3985 from saltsa/fix_lock_refresh

Fix bug in lock refresh monitoring
This commit is contained in:
Michael Eischer 2022-10-24 22:59:18 +02:00 committed by GitHub
commit f8910bc4ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,7 @@ func monitorLockRefresh(ctx context.Context, lock *restic.Lock, lockInfo *lockCo
debug.Log("terminate expiry monitoring")
return
case <-refreshed:
lastRefresh = time.Now().Unix()
lastRefresh = time.Now().UnixNano()
case <-timer.C:
if time.Now().UnixNano()-lastRefresh < refreshabilityTimeout.Nanoseconds() {
// restart timer