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
3e92216f
Commit
3e92216f
authored
Jul 12, 2020
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure to run unassign issuables worker when not in a transaction
parent
90278c06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
app/services/members/destroy_service.rb
app/services/members/destroy_service.rb
+1
-1
changelogs/unreleased/run-unassign-issuables-worker-when-out-of-transaction.yml
...run-unassign-issuables-worker-when-out-of-transaction.yml
+5
-0
spec/services/members/destroy_service_spec.rb
spec/services/members/destroy_service_spec.rb
+1
-0
No files found.
app/services/members/destroy_service.rb
View file @
3e92216f
...
@@ -69,7 +69,7 @@ module Members
...
@@ -69,7 +69,7 @@ module Members
def
enqueue_unassign_issuables
(
member
)
def
enqueue_unassign_issuables
(
member
)
source_type
=
member
.
is_a?
(
GroupMember
)
?
'Group'
:
'Project'
source_type
=
member
.
is_a?
(
GroupMember
)
?
'Group'
:
'Project'
member
.
run_after_commit
do
member
.
run_after_commit
_or_now
do
MembersDestroyer
::
UnassignIssuablesWorker
.
perform_async
(
member
.
user_id
,
member
.
source_id
,
source_type
)
MembersDestroyer
::
UnassignIssuablesWorker
.
perform_async
(
member
.
user_id
,
member
.
source_id
,
source_type
)
end
end
end
end
...
...
changelogs/unreleased/run-unassign-issuables-worker-when-out-of-transaction.yml
0 → 100644
View file @
3e92216f
---
title
:
Ensure to run unassign issuables worker when not in a transaction
merge_request
:
36680
author
:
type
:
fixed
spec/services/members/destroy_service_spec.rb
View file @
3e92216f
...
@@ -25,6 +25,7 @@ RSpec.describe Members::DestroyService do
...
@@ -25,6 +25,7 @@ RSpec.describe Members::DestroyService do
before
do
before
do
type
=
member
.
is_a?
(
GroupMember
)
?
'Group'
:
'Project'
type
=
member
.
is_a?
(
GroupMember
)
?
'Group'
:
'Project'
expect
(
TodosDestroyer
::
EntityLeaveWorker
).
to
receive
(
:perform_in
).
with
(
Todo
::
WAIT_FOR_DELETE
,
member
.
user_id
,
member
.
source_id
,
type
)
expect
(
TodosDestroyer
::
EntityLeaveWorker
).
to
receive
(
:perform_in
).
with
(
Todo
::
WAIT_FOR_DELETE
,
member
.
user_id
,
member
.
source_id
,
type
)
expect
(
MembersDestroyer
::
UnassignIssuablesWorker
).
to
receive
(
:perform_async
).
with
(
member
.
user_id
,
member
.
source_id
,
type
)
if
opts
[
:unassign_issuables
]
end
end
it
'destroys the member'
do
it
'destroys the member'
do
...
...
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