Commit 107adcd3 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'lower-explore-pages' into 'master'

Lower explore page limit

See merge request gitlab-org/gitlab!50233
parents 19d08365 b3f21f50
...@@ -9,13 +9,16 @@ class Explore::ProjectsController < Explore::ApplicationController ...@@ -9,13 +9,16 @@ class Explore::ProjectsController < Explore::ApplicationController
include SortingPreference include SortingPreference
MIN_SEARCH_LENGTH = 3 MIN_SEARCH_LENGTH = 3
PAGE_LIMIT = 50
before_action :set_non_archived_param before_action :set_non_archived_param
before_action :set_sorting before_action :set_sorting
# Limit taken from https://gitlab.com/gitlab-org/gitlab/issues/38357 # For background information on the limit, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/38357
# https://gitlab.com/gitlab-org/gitlab/-/issues/262682
before_action only: [:index, :trending, :starred] do before_action only: [:index, :trending, :starred] do
limit_pages(200) limit_pages(PAGE_LIMIT)
end end
rescue_from PageOutOfBoundsError, with: :page_out_of_bounds rescue_from PageOutOfBoundsError, with: :page_out_of_bounds
......
---
title: Lower /explore page limit
merge_request: 50233
author:
type: performance
...@@ -60,7 +60,7 @@ RSpec.describe Explore::ProjectsController do ...@@ -60,7 +60,7 @@ RSpec.describe Explore::ProjectsController do
end end
shared_examples "blocks high page numbers" do shared_examples "blocks high page numbers" do
let(:page_limit) { 200 } let(:page_limit) { described_class::PAGE_LIMIT }
context "page number is too high" do context "page number is too high" do
[:index, :trending, :starred].each do |endpoint| [:index, :trending, :starred].each do |endpoint|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment