400 experiment setup
This commit is contained in:
parent
f9bf9bc1aa
commit
f021a65ebd
@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||
"github.com/spatialcurrent/go-lazy/pkg/lazy"
|
||||
|
||||
"github.com/alcionai/corso/src/internal/common/idname"
|
||||
@ -386,9 +387,20 @@ func downloadContent(
|
||||
logger.CtxErr(ctx, err).Debug("url cache miss: refetching from API")
|
||||
counter.Inc(count.URLCacheMiss)
|
||||
|
||||
di, err := iaag.GetItem(ctx, driveID, ptr.Val(item.GetId()))
|
||||
if err != nil {
|
||||
return nil, clues.Wrap(err, "retrieving expired item")
|
||||
// di, err := iaag.GetItem(ctx, driveID, ptr.Val(item.GetId()))
|
||||
// if err != nil {
|
||||
// return nil, clues.Wrap(err, "retrieving expired item")
|
||||
// }
|
||||
|
||||
var di models.DriveItemable
|
||||
|
||||
for i := 0; i < 1000000; i++ {
|
||||
di, err := iaag.GetItem(ctx, driveID, ptr.Val(item.GetId()))
|
||||
if err != nil {
|
||||
return nil, clues.Wrap(err, "retrieving expired item")
|
||||
}
|
||||
|
||||
logger.Ctx(ctx).Debugf("iteration %d item id %s\n ", i, ptr.Val(di.GetId()))
|
||||
}
|
||||
|
||||
cdi := custom.ToCustomDriveItem(di)
|
||||
|
||||
@ -207,6 +207,11 @@ func (mw RetryMiddleware) retryRequest(
|
||||
// 1, there was a prior error OR the status code match retriable conditions.
|
||||
// 3, the request method is retriable.
|
||||
// 4, we haven't already hit maximum retries.
|
||||
|
||||
if resp != nil && resp.StatusCode == http.StatusBadRequest && IsErrInvalidRequest(priorErr, resp) {
|
||||
logger.Ctx(ctx).Infof("retrying 400_invalid_request: %s", getRespDump(ctx, resp, true))
|
||||
}
|
||||
|
||||
shouldRetry := (priorErr != nil || mw.isRetriableRespCode(ctx, resp) || IsErrInvalidRequest(priorErr, resp)) &&
|
||||
mw.isRetriableRequest(req) &&
|
||||
executionCount < mw.MaxRetries
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user