From c2330e7262a91df6de095f727aacf24601d70e2a Mon Sep 17 00:00:00 2001 From: Vaibhav Kamra Date: Tue, 7 Mar 2023 19:00:25 -0800 Subject: [PATCH] Remove extra Graph API call --- src/internal/connector/onedrive/collection.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index bf50e3f3f..51b2e3000 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -333,13 +333,17 @@ func (oc *Collection) populateItems(ctx context.Context, errs *fault.Bus) { "backup_item_size", itemSize, ) - pr, err := fetchParentReference(ctx, oc.service, item.GetParentReference()) - if err != nil { - el.AddRecoverable(clues.Wrap(err, "getting parent reference").Label(fault.LabelForceNoBackupCreation)) - return - } + // TODO: Removing the logic below because it introduces an extra Graph API call for + // every item being backed up. This can lead to throttling errors. + // + // pr, err := fetchParentReference(ctx, oc.service, item.GetParentReference()) + // if err != nil { + // el.AddRecoverable(clues.Wrap(err, "getting parent reference").Label(fault.LabelForceNoBackupCreation)) + // return + // } + + // item.SetParentReference(pr) - item.SetParentReference(pr) isFile := item.GetFile() != nil if isFile {