mirror of
https://github.com/restic/restic.git
synced 2025-12-03 23:11:47 +00:00
Merge pull request #3512 from MichaelEischer/cleaner-lock-refresh
Prevent lock refresh from leaving behind lots of stale locks
This commit is contained in:
@@ -223,15 +223,11 @@ func (l *Lock) Refresh(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = l.repo.Backend().Remove(context.TODO(), Handle{Type: LockFile, Name: l.lockID.String()})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
debug.Log("new lock ID %v", id)
|
||||
oldLockID := l.lockID
|
||||
l.lockID = &id
|
||||
|
||||
return nil
|
||||
return l.repo.Backend().Remove(context.TODO(), Handle{Type: LockFile, Name: oldLockID.String()})
|
||||
}
|
||||
|
||||
func (l Lock) String() string {
|
||||
|
||||
Reference in New Issue
Block a user