Commit b3f21f50 authored by Robert May's avatar Robert May Committed by Rémy Coutable

Lower explore page limit

Lowers the limit for explore to 50 pages deep.
parent ce7c0ced
......@@ -9,13 +9,16 @@ class Explore::ProjectsController < Explore::ApplicationController
include SortingPreference
MIN_SEARCH_LENGTH = 3
PAGE_LIMIT = 50
before_action :set_non_archived_param
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
limit_pages(200)
limit_pages(PAGE_LIMIT)
end
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
end
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
[: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