diff --git a/internal/restic/lock.go b/internal/restic/lock.go index b1584aa19..a65ed6b5c 100644 --- a/internal/restic/lock.go +++ b/internal/restic/lock.go @@ -306,15 +306,15 @@ func (l *Lock) RefreshStaleLock(ctx context.Context) error { return err } - l.lock.Lock() - defer l.lock.Unlock() - if !exists { // cleanup replacement lock _ = l.repo.Backend().Remove(context.TODO(), Handle{Type: LockFile, Name: id.String()}) return ErrRemovedLock } + l.lock.Lock() + defer l.lock.Unlock() + debug.Log("new lock ID %v", id) oldLockID := l.lockID l.lockID = &id