Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index ead2ea34227..1297f8e87a2 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -415,7 +415,7 @@ module API
projects = GroupProjectsFinder.new(
group: group,
current_user: options[:current_user],
- options: { only_owned: true }
+ options: { only_owned: true, limit: projects_limit }
).execute
Entities::Project.preload_and_batch_count!(projects)
@@ -425,11 +425,19 @@ module API
projects = GroupProjectsFinder.new(
group: group,
current_user: options[:current_user],
- options: { only_shared: true }
+ options: { only_shared: true, limit: projects_limit }
).execute
Entities::Project.preload_and_batch_count!(projects)
end
+
+ def projects_limit
+ if ::Feature.enabled?(:limit_projects_in_groups_api, default_enabled: true)
+ GroupProjectsFinder::DEFAULT_PROJECTS_LIMIT
+ else
+ nil
+ end
+ end
end
class DiffRefs < Grape::Entity