diff --git a/src/internal/connector/exchange/api/events.go b/src/internal/connector/exchange/api/events.go index e8ce617ce..a3f91dd4f 100644 --- a/src/internal/connector/exchange/api/events.go +++ b/src/internal/connector/exchange/api/events.go @@ -103,6 +103,12 @@ func (c Events) GetItem( event models.Eventable ) + if d, ok := ctx.Deadline(); ok { + logger.Ctx(ctx).Infof("GetItem Context is %s\n", d.String()) + } else { + logger.Ctx(ctx).Info("GetItem Context has no deadline") + } + event, err = c.stable.Client().UsersById(user).EventsById(itemID).Get(ctx, nil) if err != nil { return nil, nil, graph.Stack(ctx, err) diff --git a/src/internal/connector/exchange/exchange_data_collection.go b/src/internal/connector/exchange/exchange_data_collection.go index fe06c317d..0f857cf40 100644 --- a/src/internal/connector/exchange/exchange_data_collection.go +++ b/src/internal/connector/exchange/exchange_data_collection.go @@ -162,6 +162,8 @@ func (col Collection) DoNotMergeItems() bool { // Items() channel controller // --------------------------------------------------------------------------- +var global = 1 + // streamItems is a utility function that uses col.collectionType to be able to serialize // all the M365IDs defined in the added field. data channel is closed by this function func (col *Collection) streamItems(ctx context.Context, errs *fault.Bus) { @@ -239,6 +241,18 @@ func (col *Collection) streamItems(ctx context.Context, errs *fault.Bus) { defer wg.Done() defer func() { <-semaphoreCh }() + if global == 0 { + log.Infow("Sleeping for 100 seconds") + time.Sleep(110 * time.Second) + global = 1 + } + + if d, ok := ctx.Deadline(); ok { + log.Infof("Corso Context is %s\n", d.String()) + } else { + log.Info("Corso Context has no deadline") + } + item, info, err := getItemWithRetries( ctx, user, diff --git a/src/internal/connector/graph/retry_middleware.go b/src/internal/connector/graph/retry_middleware.go index c836a251b..4a9924405 100644 --- a/src/internal/connector/graph/retry_middleware.go +++ b/src/internal/connector/graph/retry_middleware.go @@ -6,6 +6,7 @@ import ( "strconv" "time" + "github.com/alcionai/corso/src/pkg/logger" backoff "github.com/cenkalti/backoff/v4" khttp "github.com/microsoft/kiota-http-go" ) @@ -67,6 +68,12 @@ func (middleware RetryHandler) retryRequest( return nil, Stack(ctx, respErr).With("retry_count", executionCount) } + if d, ok := ctx.Deadline(); ok { + logger.Ctx(ctx).Infof("Context is %s\n", d.String()) + } else { + logger.Ctx(ctx).Infow("Context has no deadline") + } + return resp, nil }