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
312bb161
Commit
312bb161
authored
Feb 06, 2020
by
a_luna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove destroy_user_associations_in_batches flag
Make the change available for everyone
parent
1af54d75
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
app/services/users/destroy_service.rb
app/services/users/destroy_service.rb
+4
-6
spec/services/users/destroy_service_spec.rb
spec/services/users/destroy_service_spec.rb
+0
-10
No files found.
app/services/users/destroy_service.rb
View file @
312bb161
...
@@ -56,12 +56,10 @@ module Users
...
@@ -56,12 +56,10 @@ module Users
MigrateToGhostUserService
.
new
(
user
).
execute
unless
options
[
:hard_delete
]
MigrateToGhostUserService
.
new
(
user
).
execute
unless
options
[
:hard_delete
]
if
Feature
.
enabled?
(
:destroy_user_associations_in_batches
)
# Rails attempts to load all related records into memory before
# Rails attempts to load all related records into memory before
# destroying: https://github.com/rails/rails/issues/22510
# destroying: https://github.com/rails/rails/issues/22510
# This ensures we delete records in batches.
# This ensures we delete records in batches.
user
.
destroy_dependent_associations_in_batches
user
.
destroy_dependent_associations_in_batches
end
# Destroy the namespace after destroying the user since certain methods may depend on the namespace existing
# Destroy the namespace after destroying the user since certain methods may depend on the namespace existing
user_data
=
user
.
destroy
user_data
=
user
.
destroy
...
...
spec/services/users/destroy_service_spec.rb
View file @
312bb161
...
@@ -26,16 +26,6 @@ describe Users::DestroyService do
...
@@ -26,16 +26,6 @@ describe Users::DestroyService do
service
.
execute
(
user
)
service
.
execute
(
user
)
end
end
context
'when :destroy_user_associations_in_batches flag is disabled'
do
it
'does not delete user associations in batches'
do
stub_feature_flags
(
destroy_user_associations_in_batches:
false
)
expect
(
user
).
not_to
receive
(
:destroy_dependent_associations_in_batches
)
service
.
execute
(
user
)
end
end
it
'will delete the project'
do
it
'will delete the project'
do
expect_next_instance_of
(
Projects
::
DestroyService
)
do
|
destroy_service
|
expect_next_instance_of
(
Projects
::
DestroyService
)
do
|
destroy_service
|
expect
(
destroy_service
).
to
receive
(
:execute
).
once
.
and_return
(
true
)
expect
(
destroy_service
).
to
receive
(
:execute
).
once
.
and_return
(
true
)
...
...
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