From 4f75b5ddc7fa1697448098c6b7a5ab9fd5c91a29 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Fri, 29 Nov 2024 21:48:32 +0530 Subject: [PATCH] changes for limit and added comment for changes --- src/Controller/PaginationHelperTrait.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Controller/PaginationHelperTrait.php b/src/Controller/PaginationHelperTrait.php index d018ca82..c56fe1f5 100644 --- a/src/Controller/PaginationHelperTrait.php +++ b/src/Controller/PaginationHelperTrait.php @@ -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);