Cherry pick cache integration changes with dummy url cache

This commit is contained in:
Abhishek Pandey 2023-05-31 04:08:30 -07:00
parent b68336a466
commit 671fd5150d
3 changed files with 7 additions and 1 deletions

View File

@ -323,7 +323,7 @@ type itemAndAPIGetter interface {
// downloadContent attempts to fetch the item content. If the content url
// is expired (ie, returns a 401), it re-fetches the item to get a new download
// url and tries again.
func downloadContent(
func (oc *Collection) downloadContent(
ctx context.Context,
iaag itemAndAPIGetter,
uc getItemPropertyer,

View File

@ -207,6 +207,8 @@ func (suite *CollectionUnitTestSuite) TestCollection() {
CollectionScopeFolder,
true,
nil)
true,
nil)
require.NoError(t, err, clues.ToCore(err))
require.NotNil(t, coll)
assert.Equal(t, folderPath, coll.FullPath())

View File

@ -63,6 +63,9 @@ type Collections struct {
NumItems int
NumFiles int
NumContainers int
// drive ID -> url cache instance
driveURLCache map[string]*urlCache
}
func NewCollections(
@ -79,6 +82,7 @@ func NewCollections(
CollectionMap: map[string]map[string]*Collection{},
statusUpdater: statusUpdater,
ctrl: ctrlOpts,
driveURLCache: map[string]*urlCache{},
}
}