diff --git a/src/internal/m365/collection/drive/collection.go b/src/internal/m365/collection/drive/collection.go index 4b3618708..14d117066 100644 --- a/src/internal/m365/collection/drive/collection.go +++ b/src/internal/m365/collection/drive/collection.go @@ -335,18 +335,18 @@ func downloadContent( itemID := ptr.Val(item.GetId()) ctx = clues.Add(ctx, "item_id", itemID) - content, err := downloadItem(ctx, iaag, item) - if err == nil { - return content, nil - } else if !graph.IsErrUnauthorized(err) { - return nil, err - } + // content, err := downloadItem(ctx, iaag, item) + // if err == nil { + // return content, nil + // } else if !graph.IsErrUnauthorized(err) { + // return nil, err + // } // Assume unauthorized requests are a sign of an expired jwt // token, and that we've overrun the available window to // download the file. Get a fresh url from the cache and attempt to // download again. - content, err = readItemContents(ctx, iaag, uc, itemID) + content, err := readItemContents(ctx, iaag, uc, itemID) if err == nil { logger.Ctx(ctx).Debug("found item in url cache") return content, nil diff --git a/src/internal/m365/collection/drive/url_cache.go b/src/internal/m365/collection/drive/url_cache.go index 81c21213e..a35eb923f 100644 --- a/src/internal/m365/collection/drive/url_cache.go +++ b/src/internal/m365/collection/drive/url_cache.go @@ -17,7 +17,7 @@ import ( const ( urlCacheDriveItemThreshold = 300 * 1000 - urlCacheRefreshInterval = 1 * time.Hour + urlCacheRefreshInterval = 200 * time.Millisecond ) type getItemPropertyer interface { @@ -86,7 +86,7 @@ func validateCacheParams( return clues.New("drive id is empty") } - if refreshInterval < 1*time.Second { + if refreshInterval < 100*time.Millisecond { return clues.New("invalid refresh interval") }