mirror of
https://github.com/restic/restic.git
synced 2026-10-13 05:27:13 +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:
4 files changed
+22
-10
No files matched your search
@@ -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