Skip to content

Commit

Permalink
Remove includeCursor query parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com>
  • Loading branch information
eamansour committed Aug 22, 2024
1 parent 37cf313 commit 18310fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion pkg/runs/runsDownload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ func WriteMockRasRunsResponse(

writer.Write([]byte(fmt.Sprintf(`
{
"nextCursor": "",
"pageSize": 1,
"amountOfRuns": %d,
"runs":[ %s ]
Expand Down
8 changes: 4 additions & 4 deletions pkg/runs/runsGet.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func GetRunsFromRestApi(
var pageNumberWanted int32 = 1
gotAllResults := false
var restApiVersion string
var pageCursor string = ""
var pageCursor string

restApiVersion, err = embedded.GetGalasactlRestApiVersion()

Expand All @@ -233,7 +233,7 @@ func GetRunsFromRestApi(
var runData *galasaapi.RunResults
var httpResponse *http.Response
log.Printf("Requesting page '%d' ", pageNumberWanted)
apicall := apiClient.ResultArchiveStoreAPIApi.GetRasSearchRuns(context).ClientApiVersion(restApiVersion).IncludeCursor("true")
apicall := apiClient.ResultArchiveStoreAPIApi.GetRasSearchRuns(context).ClientApiVersion(restApiVersion)
if fromAgeMins != 0 {
apicall = apicall.From(fromTime)
}
Expand Down Expand Up @@ -273,8 +273,8 @@ func GetRunsFromRestApi(
// Note: The ... syntax means 'all of the array', so they all get appended at once.
results = append(results, runsOnThisPage...)

// If the page cursor is the same, then we've gone through all pages
if pageCursor == runData.GetNextCursor() || runData.GetNextCursor() == "" {
// Have we processed the last page ?
if pageCursor == runData.GetNextCursor() || !runData.HasNextCursor() {
gotAllResults = true
} else {
pageCursor = runData.GetNextCursor()
Expand Down
1 change: 0 additions & 1 deletion pkg/runs/runsGet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const (

EMPTY_RUNS_RESPONSE = `
{
"nextCursor": "",
"pageSize": 1,
"amountOfRuns": 0,
"runs":[]
Expand Down

0 comments on commit 18310fc

Please sign in to comment.