Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f4fe00e2
Commit
f4fe00e2
authored
Nov 27, 2020
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed max batch size not working with pages
parent
3996bd75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lib/gitlab/diff/file_collection/merge_request_diff_batch.rb
lib/gitlab/diff/file_collection/merge_request_diff_batch.rb
+2
-2
No files found.
lib/gitlab/diff/file_collection/merge_request_diff_batch.rb
View file @
f4fe00e2
...
@@ -65,12 +65,12 @@ module Gitlab
...
@@ -65,12 +65,12 @@ module Gitlab
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def
load_paginated_collection
(
batch_page
,
batch_size
,
diff_options
)
def
load_paginated_collection
(
batch_page
,
batch_size
,
diff_options
)
batch_page
||=
DEFAULT_BATCH_PAGE
batch_page
||=
DEFAULT_BATCH_PAGE
batch_size
=
[
batch_size
.
to_i
,
DEFAULT_BATCH_SIZE
].
min
batch_size
||=
DEFAULT_BATCH_SIZE
paths
=
diff_options
&
.
fetch
(
:paths
,
nil
)
paths
=
diff_options
&
.
fetch
(
:paths
,
nil
)
paginated_collection
=
if
batch_gradual_load?
paginated_collection
=
if
batch_gradual_load?
relation
.
offset
(
batch_page
).
limit
(
batch_size
)
relation
.
offset
(
batch_page
).
limit
(
[
batch_size
.
to_i
,
DEFAULT_BATCH_SIZE
].
min
)
else
else
relation
.
page
(
batch_page
).
per
(
batch_size
)
relation
.
page
(
batch_page
).
per
(
batch_size
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment