From 416dda3d6dff9cc5effe8c430071edd40fbf1068 Mon Sep 17 00:00:00 2001 From: Abhishek Pandey Date: Mon, 14 Aug 2023 21:43:28 +0530 Subject: [PATCH] Switch back to full backups --- .../m365/collection/drive/item_collector.go | 2 + src/internal/operations/backup.go | 60 +++++++++---------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/internal/m365/collection/drive/item_collector.go b/src/internal/m365/collection/drive/item_collector.go index cde301e67..e3afacf68 100644 --- a/src/internal/m365/collection/drive/item_collector.go +++ b/src/internal/m365/collection/drive/item_collector.go @@ -131,6 +131,8 @@ func collectItems( } logger.Ctx(ctx).Info("delta query iteration end") + logger.Ctx(ctx).Info("delta query iteration end") + return DeltaUpdate{URL: newDeltaURL, Reset: invalidPrevDelta}, newPaths, excluded, nil } diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index a06d09080..46256fe7b 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -370,40 +370,40 @@ func (op *BackupOperation) do( } // Run 3 times and exit - cs := []data.BackupCollection{} - canUsePreviousBackup := false + //cs := []data.BackupCollection{} + //canUsePreviousBackup := false - var maxCount int = 2 + //var maxCount int = 2 - for i := 0; i < maxCount; i++ { - logger.Ctx(ctx).Info("delta query iteration") + //for i := 0; i < maxCount; i++ { + logger.Ctx(ctx).Info("delta query iteration") - cs, _, canUsePreviousBackup, err := produceBackupDataCollections( - ctx, - op.bp, - op.ResourceOwner, - op.Selectors, - mdColls, - lastBackupVersion, - op.Options, - op.Errors) - if err != nil { - return nil, clues.Wrap(err, "producing backup data collections") - } - - ctx = clues.Add( - ctx, - "can_use_previous_backup", canUsePreviousBackup, - "collection_count", len(cs)) - - // sleep for 5 mins - //time.Sleep(5 * time.Minute) - - if i == maxCount-1 { - return nil, clues.New("unable to produce backup collections").WithClues(ctx) - } + cs, ssmb, canUsePreviousBackup, err := produceBackupDataCollections( + ctx, + op.bp, + op.ResourceOwner, + op.Selectors, + mdColls, + lastBackupVersion, + op.Options, + op.Errors) + if err != nil { + return nil, clues.Wrap(err, "producing backup data collections") } + ctx = clues.Add( + ctx, + "can_use_previous_backup", canUsePreviousBackup, + "collection_count", len(cs)) + + // sleep for 5 mins + //time.Sleep(5 * time.Minute) + + // if i == maxCount-1 { + // return nil, clues.New("unable to produce backup collections").WithClues(ctx) + // } + //} + writeStats, deets, toMerge, err := consumeBackupCollections( ctx, op.kopia, @@ -411,7 +411,7 @@ func (op *BackupOperation) do( reasons, mans, cs, - nil, + ssmb, backupID, op.incremental && canUseMetadata && canUsePreviousBackup, op.Errors)