diff --git a/src/internal/m365/backup.go b/src/internal/m365/backup.go index 477980f71..8d91ac419 100644 --- a/src/internal/m365/backup.go +++ b/src/internal/m365/backup.go @@ -46,8 +46,6 @@ func (ctrl *Controller) ProduceBackupCollections( diagnostics.Index("service", bpc.Selector.PathService().String())) defer end() - ctx = graph.BindRateLimiterConfig(ctx, graph.LimiterCfg{Service: service}) - // Limit the max number of active requests to graph from this collection. bpc.Options.Parallelism.ItemFetch = graph.Parallelism(service). ItemOverride(ctx, bpc.Options.Parallelism.ItemFetch) diff --git a/src/internal/m365/collection/drive/collection.go b/src/internal/m365/collection/drive/collection.go index e27a94cdb..a472f7afe 100644 --- a/src/internal/m365/collection/drive/collection.go +++ b/src/internal/m365/collection/drive/collection.go @@ -589,14 +589,6 @@ func (oc *Collection) streamDriveItem( parentPath) ctx = clues.Add(ctx, "item_info", itemInfo) - // Drive content download requests are also rate limited by graph api. - // Ensure that this request goes through the drive limiter & not the default - // limiter. - ctx = graph.BindRateLimiterConfig( - ctx, - graph.LimiterCfg{ - Service: path.OneDriveService, - }) if isFile { dataSuffix := metadata.DataFileSuffix diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 4a6f9c061..c369a447f 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -424,6 +424,13 @@ func (op *BackupOperation) do( lastBackupVersion = mans.MinBackupVersion() } + // Select an appropriate rate limiter for the service. + ctx = graph.BindRateLimiterConfig( + ctx, + graph.LimiterCfg{ + Service: op.Selectors.PathService(), + }) + // TODO(ashmrtn): This should probably just return a collection that deletes // the entire subtree instead of returning an additional bool. That way base // selection is controlled completely by flags and merging is controlled