Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9154: adds final pass through collection retrieval loop #47

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion services/datamanager/collection/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,16 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections, err e
remainingCollections := 1
var totalCollections int
var previousTotalCollections int
for remainingCollections > 0 {
continueRetrievingCollections := true
for continueRetrievingCollections {
// We're still finding new collections
if remainingCollections <= 0 {
// this will be our last time through the loop
log.Printf("no more collections remain, waiting 1s before making one final retrieval to ensure we have all collections up to the final timestamp")
time.Sleep(1000 * time.Millisecond)
sdkParams["filters"].([][]string)[0][1] = "=="
continueRetrievingCollections = false
}

// Write the heap profile for examining memory usage
err = WriteHeapProfile()
Expand Down Expand Up @@ -245,6 +253,7 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections, err e
collectionInfo["max_manifest_size"] = maxManifestSize
})
}

}

// Make one final API request to verify that we have processed all collections available up to the latest modification date
Expand Down