backup: hide files from status which are read completely but not saved

As the FileSaver is asynchronously waiting for all blobs of a file to be
stored, the number of active files is higher than the number of files
from which restic is reading concurrently. Thus to not confuse users,
only display files in the status from which restic is currently reading.
This commit is contained in:
Michael Eischer
2022-10-22 12:05:49 +02:00
parent a571fc4aa1
commit c0f34af9db
4 changed files with 50 additions and 20 deletions

View File

@@ -60,6 +60,7 @@ func TestFileSaver(t *testing.T) {
defer cleanup()
startFn := func() {}
completeReadingFn := func() {}
completeFn := func(*restic.Node, ItemStats) {}
testFs := fs.Local{}
@@ -78,7 +79,7 @@ func TestFileSaver(t *testing.T) {
t.Fatal(err)
}
ff := s.Save(ctx, filename, filename, f, fi, startFn, completeFn)
ff := s.Save(ctx, filename, filename, f, fi, startFn, completeReadingFn, completeFn)
results = append(results, ff)
}