Test changes

This commit is contained in:
Abhishek Pandey 2023-10-17 12:21:24 -07:00
parent 24cd72792e
commit e3f1260b4b
2 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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")
}