Skip to content

Commit

Permalink
Update comment describing the need for next token
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Silva <[email protected]>
  • Loading branch information
rapphil committed Oct 21, 2024
1 parent 585a60f commit d313df6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,8 @@ func (api *API) rules(r *http.Request) apiFuncResult {
// If the rule group response has no rules, skip it - this means we filtered all the rules of this group.
if len(apiRuleGroup.Rules) > 0 {
if maxGroups > 0 && len(rgs) == int(maxGroups) {
// We've reached the capacity of our page.
// We've reached the capacity of our page plus one. That means that for sure there will be at least one
// rule group in a subsequent request. Therefore a next token is required.
res.GroupNextToken = getRuleGroupNextToken(grp.File(), grp.Name())
break
}
Expand Down

0 comments on commit d313df6

Please sign in to comment.