mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
backend: refactor backend Connections and HasAtomicReplace into Properties
This commit is contained in:
@@ -166,7 +166,7 @@ func (be *Backend) Save(ctx context.Context, h backend.Handle, rd backend.Rewind
|
||||
return nil
|
||||
}
|
||||
|
||||
if be.Backend.HasAtomicReplace() {
|
||||
if be.Backend.Properties().HasAtomicReplace {
|
||||
debug.Log("Save(%v) failed with error: %v", h, err)
|
||||
// there is no need to remove files from backends which can atomically replace files
|
||||
// in fact if something goes wrong at the backend side the delete operation might delete the wrong instance of the file
|
||||
|
||||
@@ -69,7 +69,12 @@ func TestBackendSaveRetryAtomic(t *testing.T) {
|
||||
calledRemove = true
|
||||
return nil
|
||||
},
|
||||
HasAtomicReplaceFn: func() bool { return true },
|
||||
PropertiesFn: func() backend.Properties {
|
||||
return backend.Properties{
|
||||
Connections: 2,
|
||||
HasAtomicReplace: true,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
TestFastRetries(t)
|
||||
|
||||
Reference in New Issue
Block a user