Skip to content

Commit

Permalink
Move worker call outside transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
zwolf committed Oct 18, 2023
1 parent 90f8a6e commit 3cbae6c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/project_copier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def copy
# Should this all be wrapped in a transaction?
# to ensure we rollback an sub resource creations,
# e.g. inband primary lang strings for the associated resources....
Project.transaction(requires_new: true) do
copied_project = Project.transaction(requires_new: true) do
copied_project = copy_project

# save the project and create the project versions for use in translation strings
Expand All @@ -36,12 +36,14 @@ def copy
# to keep the translations system working with these copied resources
setup_associated_primary_language_translations(copied_project)

# Creates Talk roles via background worker
TalkAdminCreateWorker.perform_async(copied_project.id)

# return the newly copied project
copied_project
end

# Creates Talk roles via background worker
TalkAdminCreateWorker.perform_async(copied_project.id)

# return the newly copied project
copied_project
end

private
Expand Down

0 comments on commit 3cbae6c

Please sign in to comment.