mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 10:58:55 +00:00
lock: Ignore empty lock files
These may be left behind by backends which do not guarantee atomic uploads.
This commit is contained in:
parent
20ad14e362
commit
57acc769b4
@ -360,6 +360,12 @@ func ForAllLocks(ctx context.Context, repo Repository, excludeID *ID, fn func(ID
|
||||
if excludeID != nil && id.Equal(*excludeID) {
|
||||
return nil
|
||||
}
|
||||
if size == 0 {
|
||||
// Ignore empty lock files as some backends do not guarantee atomic uploads.
|
||||
// These may leave empty files behind if an upload was interrupted between
|
||||
// creating the file and writing its data.
|
||||
return nil
|
||||
}
|
||||
lock, err := LoadLock(ctx, repo, id)
|
||||
|
||||
m.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user