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
794c805e
Commit
794c805e
authored
Sep 24, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer take over first
Take does not apply an order
parent
a24659e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
app/workers/issue_placement_worker.rb
app/workers/issue_placement_worker.rb
+4
-4
app/workers/issue_rebalancing_worker.rb
app/workers/issue_rebalancing_worker.rb
+2
-1
changelogs/unreleased/ajk-issue-reposition-take.yml
changelogs/unreleased/ajk-issue-reposition-take.yml
+5
-0
No files found.
app/workers/issue_placement_worker.rb
View file @
794c805e
...
@@ -36,14 +36,14 @@ class IssuePlacementWorker
...
@@ -36,14 +36,14 @@ class IssuePlacementWorker
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
issue_id:
issue_id
,
project_id:
project_id
)
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
issue_id:
issue_id
,
project_id:
project_id
)
IssueRebalancingWorker
.
perform_async
(
nil
,
project_id
.
presence
||
issue
.
project_id
)
IssueRebalancingWorker
.
perform_async
(
nil
,
project_id
.
presence
||
issue
.
project_id
)
end
end
# rubocop: enable CodeReuse/ActiveRecord
def
find_issue
(
issue_id
,
project_id
)
def
find_issue
(
issue_id
,
project_id
)
return
Issue
.
id_in
(
issue_id
).
first
if
issue_id
return
Issue
.
id_in
(
issue_id
).
take
if
issue_id
project
=
Project
.
id_in
(
project_id
).
first
project
=
Project
.
id_in
(
project_id
).
take
return
unless
project
return
unless
project
project
.
issues
.
first
project
.
issues
.
take
end
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
app/workers/issue_rebalancing_worker.rb
View file @
794c805e
...
@@ -11,7 +11,8 @@ class IssueRebalancingWorker
...
@@ -11,7 +11,8 @@ class IssueRebalancingWorker
return
if
project_id
.
nil?
return
if
project_id
.
nil?
project
=
Project
.
find
(
project_id
)
project
=
Project
.
find
(
project_id
)
issue
=
project
.
issues
.
first
# All issues are equivalent as far as we are concerned
# All issues are equivalent as far as we are concerned
issue
=
project
.
issues
.
take
# rubocop: disable CodeReuse/ActiveRecord
IssueRebalancingService
.
new
(
issue
).
execute
IssueRebalancingService
.
new
(
issue
).
execute
rescue
ActiveRecord
::
RecordNotFound
,
IssueRebalancingService
::
TooManyIssues
=>
e
rescue
ActiveRecord
::
RecordNotFound
,
IssueRebalancingService
::
TooManyIssues
=>
e
...
...
changelogs/unreleased/ajk-issue-reposition-take.yml
0 → 100644
View file @
794c805e
---
title
:
Performance fix for issue placement
merge_request
:
43315
author
:
type
:
performance
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