mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 04:33:37 +08:00
FIX: Perform topics merge in a background thread (#28114)
Similar to https://github.com/discourse/discourse/pull/28061, merging topics with many posts can exceed the 30 seconds timeout that Unicorn workers are limited to, so we should move the operation into a background thread to get around this limit. Internal topic: t/133710.
This commit is contained in:
parent
647294ad7b
commit
731fcad3d5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user