From 9bd3a628844338ce0c81fee3c22a10cb4cae3198 Mon Sep 17 00:00:00 2001 From: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:33:22 +0100 Subject: [PATCH] Remove includeCursor query parameter Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --- pkg/runs/runsDownload_test.go | 1 - pkg/runs/runsGet.go | 4 ++-- pkg/runs/runsGet_test.go | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/runs/runsDownload_test.go b/pkg/runs/runsDownload_test.go index da726600..06d48490 100644 --- a/pkg/runs/runsDownload_test.go +++ b/pkg/runs/runsDownload_test.go @@ -250,7 +250,6 @@ func WriteMockRasRunsResponse( writer.Write([]byte(fmt.Sprintf(` { - "nextCursor": "", "pageSize": 1, "amountOfRuns": %d, "runs":[ %s ] diff --git a/pkg/runs/runsGet.go b/pkg/runs/runsGet.go index 851385c5..ac7ef01f 100644 --- a/pkg/runs/runsGet.go +++ b/pkg/runs/runsGet.go @@ -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) } @@ -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() diff --git a/pkg/runs/runsGet_test.go b/pkg/runs/runsGet_test.go index 2937fb78..1a9968c4 100644 --- a/pkg/runs/runsGet_test.go +++ b/pkg/runs/runsGet_test.go @@ -86,7 +86,6 @@ const ( EMPTY_RUNS_RESPONSE = ` { - "nextCursor": "", "pageSize": 1, "amountOfRuns": 0, "runs":[]