From f84e4e9239af2b891aac190e2de1d051cc479ee9 Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Sat, 28 Jan 2023 13:40:08 -0500 Subject: [PATCH] Updates to sharepoint/collection.go Changes to troubleshoot Issue #2257 --- src/internal/connector/sharepoint/collection.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal/connector/sharepoint/collection.go b/src/internal/connector/sharepoint/collection.go index 458be0a74..ac41fb501 100644 --- a/src/internal/connector/sharepoint/collection.go +++ b/src/internal/connector/sharepoint/collection.go @@ -149,7 +149,7 @@ func (sc *Collection) finishPopulation(ctx context.Context, attempts, success in status := support.CreateStatus( ctx, support.Backup, - len(sc.jobs), + 1, // 1 folder support.CollectionMetrics{ Objects: attempted, Successes: success, @@ -172,6 +172,9 @@ func (sc *Collection) populate(ctx context.Context) { writer = kw.NewJsonSerializationWriter() ) + defer func() { + sc.finishPopulation(ctx, metrics.attempts, metrics.success, int64(metrics.success), errs) + }() // TODO: Insert correct ID for CollectionProgress colProgress, closer := observe.CollectionProgress( ctx, @@ -182,7 +185,6 @@ func (sc *Collection) populate(ctx context.Context) { defer func() { close(colProgress) - sc.finishPopulation(ctx, metrics.attempts, metrics.success, metrics.totalBytes, errs) }() // Switch retrieval function based on category