Updates to sharepoint/collection.go

Changes to troubleshoot Issue #2257
This commit is contained in:
Danny Adams 2023-01-28 13:40:08 -05:00
parent 9799add342
commit f84e4e9239

View File

@ -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