Skip to content

Commit

Permalink
changes for limit and added comment for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarkhaire committed Nov 29, 2024
1 parent 1c62281 commit 4f75b5d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Controller/PaginationHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,19 @@ private function listEntityIdsWithCps(?PagerInterface $pager = null, array $quer
if (empty($ids)) {
return [];
}
if (count($ids) > 100) {
// The default pagination limit (aka. "count") on CPS supported
// listing endpoints varies. When this script was written it was
// 1000 on two endpoints and 100 on two app related endpoints,
// namely List Developer Apps and List Company Apps. A
// developer/company should not have 100 apps, this is
// the reason why this limit is smaller. Therefore we choose to
// use 1000 as max limit to improve performance of page.
// Developers & Companies with more than 100 Apps will face
// performance issue.
// https://apidocs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/apiproducts-0
// https://apidocs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/developers
// https://apidocs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D/apps
if (count($ids) > 1000) {
$lastId = end($ids);
do {
$tmp = $this->getResultsInRange($this->createPager(0, $lastId), $query_params, $expandCompatibility);
Expand Down

0 comments on commit 4f75b5d

Please sign in to comment.