Merge branch 'backup-page-flow-3' into backup-page-flow-3-cliPicked

This commit is contained in:
Danny Adams 2023-01-21 02:13:44 -05:00
commit 13c9a847e2
3 changed files with 8 additions and 5 deletions

View File

@ -66,6 +66,7 @@ func NewCollection(
service graph.Servicer, service graph.Servicer,
category DataCategory, category DataCategory,
statusUpdater support.StatusUpdater, statusUpdater support.StatusUpdater,
ctrlOpts control.Options,
) *Collection { ) *Collection {
c := &Collection{ c := &Collection{
fullPath: folderPath, fullPath: folderPath,
@ -74,6 +75,7 @@ func NewCollection(
service: service, service: service,
statusUpdater: statusUpdater, statusUpdater: statusUpdater,
category: category, category: category,
ctrl: ctrlOpts,
} }
return c return c

View File

@ -17,6 +17,7 @@ import (
"github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/internal/connector/support"
"github.com/alcionai/corso/src/internal/data" "github.com/alcionai/corso/src/internal/data"
"github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester"
"github.com/alcionai/corso/src/pkg/control"
"github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/path"
) )
@ -73,7 +74,7 @@ func (suite *SharePointCollectionSuite) TestSharePointListCollection() {
false) false)
require.NoError(t, err) require.NoError(t, err)
col := NewCollection(dir, nil, List, nil) col := NewCollection(dir, nil, List, nil, control.Options{})
col.data <- &Item{ col.data <- &Item{
id: testName, id: testName,
data: io.NopCloser(bytes.NewReader(byteArray)), data: io.NopCloser(bytes.NewReader(byteArray)),
@ -100,7 +101,7 @@ func (suite *SharePointCollectionSuite) TestSharePointPageCollection_Populate()
defer flush() defer flush()
t := suite.T() t := suite.T()
count := 1 count := 0
siteID := tester.M365SiteID(t) siteID := tester.M365SiteID(t)
a := tester.NewM365Account(t) a := tester.NewM365Account(t)
account, err := a.M365Config() account, err := a.M365Config()
@ -122,7 +123,7 @@ func (suite *SharePointCollectionSuite) TestSharePointPageCollection_Populate()
) )
require.NoError(t, err) require.NoError(t, err)
col := NewCollection(dir, service, Pages, nil) col := NewCollection(dir, service, Pages, nil, control.Defaults())
col.jobs = []string{tuples[0].id} col.jobs = []string{tuples[0].id}
streamChannel := col.Items() streamChannel := col.Items()

View File

@ -123,7 +123,7 @@ func collectLists(
return nil, errors.Wrapf(err, "failed to create collection path for site: %s", siteID) return nil, errors.Wrapf(err, "failed to create collection path for site: %s", siteID)
} }
collection := NewCollection(dir, serv, List, updater.UpdateStatus) collection := NewCollection(dir, serv, List, updater.UpdateStatus, ctrlOpts)
collection.AddJob(tuple.id) collection.AddJob(tuple.id)
spcs = append(spcs, collection) spcs = append(spcs, collection)
@ -197,7 +197,7 @@ func collectPages(
return nil, errors.Wrapf(err, "failed to create collection path for site: %s", siteID) return nil, errors.Wrapf(err, "failed to create collection path for site: %s", siteID)
} }
collection := NewCollection(dir, serv, Pages, updater.UpdateStatus) collection := NewCollection(dir, serv, Pages, updater.UpdateStatus, ctrlOpts)
collection.AddJob(tuple.id) collection.AddJob(tuple.id)
spcs = append(spcs, collection) spcs = append(spcs, collection)