mirror of
https://github.com/kopia/kopia.git
synced 2026-05-08 06:42:51 -04:00
removed content.Manager.ListContents*() API
This commit is contained in:
@@ -598,10 +598,8 @@ func maybeParallelExecutor(parallel int, originalCallback IterateCallback) (Iter
|
||||
|
||||
cleanup := func() error {
|
||||
once.Do(func() {
|
||||
log.Infof("finishing parallel iteration")
|
||||
close(workch)
|
||||
wg.Wait()
|
||||
log.Infof("finished parallel iteration")
|
||||
})
|
||||
return lastWorkerError()
|
||||
}
|
||||
|
||||
@@ -636,6 +636,7 @@ func TestIterateContents(t *testing.T) {
|
||||
desc: "failure",
|
||||
options: IterateOptions{},
|
||||
fail: someError,
|
||||
want: map[ID]bool{},
|
||||
},
|
||||
{
|
||||
desc: "failure-parallel",
|
||||
@@ -643,6 +644,7 @@ func TestIterateContents(t *testing.T) {
|
||||
Parallel: 10,
|
||||
},
|
||||
fail: someError,
|
||||
want: map[ID]bool{},
|
||||
},
|
||||
{
|
||||
desc: "parallel, include deleted",
|
||||
@@ -685,20 +687,19 @@ func TestIterateContents(t *testing.T) {
|
||||
if tc.fail != nil {
|
||||
return tc.fail
|
||||
}
|
||||
|
||||
mu.Lock()
|
||||
got[ci.ID] = true
|
||||
mu.Unlock()
|
||||
return nil
|
||||
})
|
||||
|
||||
if (err != nil) != (tc.fail != nil) {
|
||||
if tc.fail != err {
|
||||
t.Errorf("error iterating: %v", err)
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
if !reflect.DeepEqual(got, tc.want) {
|
||||
t.Errorf("invalid content IDs got: %v, want %v", got, tc.want)
|
||||
}
|
||||
if !reflect.DeepEqual(got, tc.want) {
|
||||
t.Errorf("invalid content IDs got: %v, want %v", got, tc.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user