Skip to content

Commit

Permalink
Merge pull request #1835 from josephschorr/lr-early-terminate
Browse files Browse the repository at this point in the history
Early terminate in LookupResources when no limit was specified
  • Loading branch information
alecmerdler authored Mar 27, 2024
2 parents 903ebd6 + bd5d7d0 commit d639bb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/graph/lookupresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ func (cl *CursoredLookupResources) LookupResources(
}

reachableResourcesCursor = newCursor
if reachableCount == 0 {

// If no additional reachable results were found or the request was unlimited, then we can stop.
if reachableCount == 0 || req.OptionalLimit == 0 {
return nil
}
}
Expand Down

0 comments on commit d639bb0

Please sign in to comment.