Add reset
This commit is contained in:
parent
1d1603e0ad
commit
ed6d1066ed
@ -401,6 +401,7 @@ func readItemContents(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.CtxErr(ctx, err).Info("item served from url cache")
|
||||||
return rc, nil
|
return rc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -327,6 +327,24 @@ func (c *Collections) Get(
|
|||||||
"num_deltas_entries", numDeltas,
|
"num_deltas_entries", numDeltas,
|
||||||
"delta_reset", delta.Reset)
|
"delta_reset", delta.Reset)
|
||||||
|
|
||||||
|
numDriveItems := c.NumItems - numPrevItems
|
||||||
|
numPrevItems = c.NumItems
|
||||||
|
|
||||||
|
// Only create a drive cache if there are less than 300k items in the drive.
|
||||||
|
if numDriveItems < urlCacheDriveItemThreshold {
|
||||||
|
logger.Ctx(ictx).Info("adding url cache for drive ", driveID)
|
||||||
|
logger.Ctx(ictx).Info("url cache: new items in drive ", numDriveItems)
|
||||||
|
|
||||||
|
err = c.addURLCacheToDriveCollections(
|
||||||
|
ictx,
|
||||||
|
driveID,
|
||||||
|
prevDelta,
|
||||||
|
errs)
|
||||||
|
if err != nil {
|
||||||
|
return nil, false, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// For both cases we don't need to do set difference on folder map if the
|
// For both cases we don't need to do set difference on folder map if the
|
||||||
// delta token was valid because we should see all the changes.
|
// delta token was valid because we should see all the changes.
|
||||||
if !delta.Reset {
|
if !delta.Reset {
|
||||||
|
|||||||
@ -177,6 +177,9 @@ func (uc *urlCache) deltaQuery(
|
|||||||
) error {
|
) error {
|
||||||
logger.Ctx(ctx).Debug("starting delta query")
|
logger.Ctx(ctx).Debug("starting delta query")
|
||||||
|
|
||||||
|
// Reset item pager to remove any previous state
|
||||||
|
uc.itemPager.Reset()
|
||||||
|
|
||||||
_, _, _, err := collectItems(
|
_, _, _, err := collectItems(
|
||||||
ctx,
|
ctx,
|
||||||
uc.itemPager,
|
uc.itemPager,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user