mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
FIX: Don't enqueue jobs in a transaction
This commit is contained in:
@ -145,7 +145,7 @@ class PostCreator
|
||||
publish
|
||||
|
||||
track_latest_on_category
|
||||
enqueue_jobs
|
||||
enqueue_jobs unless @opts[:skip_jobs]
|
||||
BadgeGranter.queue_badge_grant(Badge::Trigger::PostRevision, post: @post)
|
||||
|
||||
trigger_after_events(@post)
|
||||
@ -170,6 +170,11 @@ class PostCreator
|
||||
@post
|
||||
end
|
||||
|
||||
def enqueue_jobs
|
||||
return unless @post && !@post.errors.present?
|
||||
PostJobsEnqueuer.new(@post, @topic, new_topic?, {import_mode: @opts[:import_mode]}).enqueue_jobs
|
||||
end
|
||||
|
||||
def self.track_post_stats
|
||||
Rails.env != "test".freeze || @track_post_stats
|
||||
end
|
||||
@ -449,11 +454,6 @@ class PostCreator
|
||||
end
|
||||
end
|
||||
|
||||
def enqueue_jobs
|
||||
return unless @post && !@post.errors.present?
|
||||
PostJobsEnqueuer.new(@post, @topic, new_topic?, {import_mode: @opts[:import_mode]}).enqueue_jobs
|
||||
end
|
||||
|
||||
def new_topic?
|
||||
@opts[:topic_id].blank?
|
||||
end
|
||||
|
Reference in New Issue
Block a user