Skip to content

Commit

Permalink
Merge branch 'master' into release-bump-4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mattermost-build committed Dec 22, 2023
2 parents 793354f + 9950c0e commit 31fc66f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions server/client_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ func (client jiraCloudClient) ListProjects(query string, limit int, expandIssueT
result.Values = result.Values[:remaining]
}
out = append(out, result.Values...)
remaining -= len(result.Values)

if !fetchAll && remaining == 0 {
// Got enough.
return out, nil
if !fetchAll {
remaining -= len(result.Values)
if remaining == 0 {
// Got enough.
return out, nil
}
}
if len(result.Values) == 0 || result.IsLast {
// Ran out of results.
Expand Down

0 comments on commit 31fc66f

Please sign in to comment.