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 6bab24c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 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
6 changes: 3 additions & 3 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 @@ -274,7 +274,7 @@ func GetRunsFromRestApi(
results = append(results, runsOnThisPage...)

// If the page cursor is the same, then we've gone through all pages
if pageCursor == runData.GetNextCursor() || runData.GetNextCursor() == "" {
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 6bab24c

Please sign in to comment.