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
6c15d7ea
Commit
6c15d7ea
authored
Sep 10, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor reviewer suggestions
parent
4df22062
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
app/workers/issue_placement_worker.rb
app/workers/issue_placement_worker.rb
+1
-2
spec/workers/issue_placement_worker_spec.rb
spec/workers/issue_placement_worker_spec.rb
+1
-1
No files found.
app/workers/issue_placement_worker.rb
View file @
6c15d7ea
...
@@ -27,8 +27,7 @@ class IssuePlacementWorker
...
@@ -27,8 +27,7 @@ class IssuePlacementWorker
.
limit
(
QUERY_LIMIT
+
1
)
.
limit
(
QUERY_LIMIT
+
1
)
.
to_a
.
to_a
leftover
=
to_place
.
last
if
to_place
.
count
>
QUERY_LIMIT
leftover
=
to_place
.
pop
if
to_place
.
count
>
QUERY_LIMIT
to_place
=
to_place
.
take
(
QUERY_LIMIT
)
Issue
.
move_nulls_to_end
(
to_place
)
Issue
.
move_nulls_to_end
(
to_place
)
Issues
::
BaseService
.
new
(
nil
).
rebalance_if_needed
(
to_place
.
max_by
(
&
:relative_position
))
Issues
::
BaseService
.
new
(
nil
).
rebalance_if_needed
(
to_place
.
max_by
(
&
:relative_position
))
...
...
spec/workers/issue_placement_worker_spec.rb
View file @
6c15d7ea
...
@@ -38,7 +38,7 @@ RSpec.describe IssuePlacementWorker do
...
@@ -38,7 +38,7 @@ RSpec.describe IssuePlacementWorker do
end
end
context
'there are more than QUERY_LIMIT unplaced issues'
do
context
'there are more than QUERY_LIMIT unplaced issues'
do
let_it_be
(
:unplaced
)
do
before_all
do
# Ensure there are more than N issues in this set
# Ensure there are more than N issues in this set
n
=
described_class
::
QUERY_LIMIT
n
=
described_class
::
QUERY_LIMIT
create_list
(
:issue
,
n
-
5
,
**
unplaced
)
create_list
(
:issue
,
n
-
5
,
**
unplaced
)
...
...
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