Cherry pick cache integration changes with dummy url cache
This commit is contained in:
parent
b68336a466
commit
671fd5150d
@ -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,
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -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{},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user