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
c3a1afa6
Commit
c3a1afa6
authored
Sep 24, 2020
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ajk-issue-reposition-take' into 'master'
Prefer take over first See merge request gitlab-org/gitlab!43315
parents
13f53339
794c805e
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 @
c3a1afa6
...
...
@@ -36,14 +36,14 @@ class IssuePlacementWorker
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
issue_id:
issue_id
,
project_id:
project_id
)
IssueRebalancingWorker
.
perform_async
(
nil
,
project_id
.
presence
||
issue
.
project_id
)
end
# rubocop: enable CodeReuse/ActiveRecord
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
project
.
issues
.
first
project
.
issues
.
take
end
# rubocop: enable CodeReuse/ActiveRecord
end
app/workers/issue_rebalancing_worker.rb
View file @
c3a1afa6
...
...
@@ -11,7 +11,8 @@ class IssueRebalancingWorker
return
if
project_id
.
nil?
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
rescue
ActiveRecord
::
RecordNotFound
,
IssueRebalancingService
::
TooManyIssues
=>
e
...
...
changelogs/unreleased/ajk-issue-reposition-take.yml
0 → 100644
View file @
c3a1afa6
---
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