Commit 42399df5 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Remove subtransaction from OverwriteProjectService

There is no need for requires_new: true here because any error in the
inner transactions are not rescued anyway so the parent transaction will
still be aborted
parent b50ffcb5
......@@ -5,7 +5,7 @@ module Projects
def execute(source_project, remove_remaining_elements: true)
return unless super
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
move_deploy_keys_projects
remove_remaining_deploy_keys_projects if remove_remaining_elements
......
......@@ -5,7 +5,7 @@ module Projects
def execute(source_project, remove_remaining_elements: true)
return unless super && source_project.fork_network
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
move_fork_network_members
update_root_project
refresh_forks_count
......
......@@ -5,7 +5,7 @@ module Projects
def execute(source_project, remove_remaining_elements: true)
return unless super
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
move_lfs_objects_projects
remove_remaining_lfs_objects_project if remove_remaining_elements
......
......@@ -5,7 +5,7 @@ module Projects
def execute(source_project, remove_remaining_elements: true)
return unless super
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
move_notification_settings
remove_remaining_notification_settings if remove_remaining_elements
......
......@@ -9,7 +9,7 @@ module Projects
def execute(source_project, remove_remaining_elements: true)
return unless super
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
move_project_authorizations
remove_remaining_authorizations if remove_remaining_elements
......
......@@ -9,7 +9,7 @@ module Projects
def execute(source_project, remove_remaining_elements: true)
return unless super
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
move_group_links
remove_remaining_project_group_links if remove_remaining_elements
......
......@@ -9,7 +9,7 @@ module Projects
def execute(source_project, remove_remaining_elements: true)
return unless super
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
move_project_members
remove_remaining_members if remove_remaining_elements
......
......@@ -9,7 +9,7 @@ module Projects
return unless user_stars.any?
Project.transaction(requires_new: true) do # rubocop:disable Performance/ActiveRecordSubtransactions
Project.transaction do
user_stars.update_all(project_id: @project.id)
Project.reset_counters @project.id, :users_star_projects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment