mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Remove error for PostCreator in a transaction without skip_jobs (#11291)
Partial revert of b143412be4
(the refactoring is not reverted)
This broke a few things, so we need to investigate and make some changes before reinstating the error
This commit is contained in:
parent
d815b95935
commit
0c878ef304
@ -199,12 +199,6 @@ class PostCreator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
if !Rails.env.test? && !@opts[:import_mode]
|
|
||||||
if ActiveRecord::Base.connection.open_transactions > 0 && !@opts[:skip_jobs]
|
|
||||||
raise "You must use 'skip_jobs = true' when creating a post inside a transaction, otherwise jobs won't run properly."
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if valid?
|
if valid?
|
||||||
transaction do
|
transaction do
|
||||||
build_post_stats
|
build_post_stats
|
||||||
|
Loading…
Reference in New Issue
Block a user