retain map, wait for 5 mins
This commit is contained in:
parent
e67bbac5ed
commit
f8af114c13
@ -8,6 +8,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
"unsafe"
|
||||||
|
|
||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||||
@ -467,8 +468,12 @@ func (oc *Collection) populateItems(ctx context.Context, errs *fault.Bus) {
|
|||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
|
// print memory for oc.DriveItems
|
||||||
|
size := unsafe.Sizeof(oc.driveItems)
|
||||||
|
logger.Ctx(ctx).Infow("driveItems map size", "size", size)
|
||||||
|
|
||||||
// free up memory
|
// free up memory
|
||||||
oc.driveItems = make(map[string]models.DriveItemable)
|
//oc.driveItems = make(map[string]models.DriveItemable)
|
||||||
oc.reportAsCompleted(ctx, int(stats.itemsFound), int(stats.itemsRead), stats.byteCount)
|
oc.reportAsCompleted(ctx, int(stats.itemsFound), int(stats.itemsRead), stats.byteCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -373,7 +373,7 @@ func (op *BackupOperation) do(
|
|||||||
cs := []data.BackupCollection{}
|
cs := []data.BackupCollection{}
|
||||||
canUsePreviousBackup := false
|
canUsePreviousBackup := false
|
||||||
|
|
||||||
var maxCount int = 5
|
var maxCount int = 2
|
||||||
|
|
||||||
for i := 0; i < maxCount; i++ {
|
for i := 0; i < maxCount; i++ {
|
||||||
logger.Ctx(ctx).Info("delta query iteration")
|
logger.Ctx(ctx).Info("delta query iteration")
|
||||||
@ -396,6 +396,9 @@ func (op *BackupOperation) do(
|
|||||||
"can_use_previous_backup", canUsePreviousBackup,
|
"can_use_previous_backup", canUsePreviousBackup,
|
||||||
"collection_count", len(cs))
|
"collection_count", len(cs))
|
||||||
|
|
||||||
|
// sleep for 5 mins
|
||||||
|
time.Sleep(5 * time.Minute)
|
||||||
|
|
||||||
if i == maxCount-1 {
|
if i == maxCount-1 {
|
||||||
return nil, clues.New("unable to produce backup collections").WithClues(ctx)
|
return nil, clues.New("unable to produce backup collections").WithClues(ctx)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user