Skip to content

A platform for community discussion. Free, open, simple.

FIX: Perform topics merge in a background thread (#28114)

Osama Sayegh731fcad3d536
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb
index f6f99aa0b0f..95431ad9825 100644
--- a/app/controllers/topics_controller.rb
+++ b/app/controllers/topics_controller.rb
@@ -855,8 +855,11 @@ class TopicsController < ApplicationController
params[:archetype] == "private_message"
end
- destination_topic = topic.move_posts(current_user, topic.posts.pluck(:id), args)
- render_topic_changes(destination_topic)
+ acting_user = current_user
+ hijack(info: "merging topic #{topic_id.inspect} into #{destination_topic_id.inspect}") do
+ destination_topic = topic.move_posts(acting_user, topic.posts.pluck(:id), args)
+ render_topic_changes(destination_topic)
+ end
end
def move_posts