Log deadlines
This commit is contained in:
parent
78f109758c
commit
4c1a6caabf
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user