Similarly to #2426, put creation of remote statuses in a transaction, (#3233)

so that public timeline/caching would not encounter incomplete data
pull/3236/head
Eugen Rochko 2017-05-22 19:35:48 +02:00 committed by GitHub
parent bda7391221
commit 4a4733b397
1 changed files with 18 additions and 13 deletions

View File

@ -47,7 +47,11 @@ class ProcessFeedService < BaseService
return
end
status, just_created = nil
Rails.logger.debug "Creating remote status #{id}"
ApplicationRecord.transaction do
status, just_created = status_from_xml(@xml)
return if status.nil?
@ -66,6 +70,7 @@ class ProcessFeedService < BaseService
end
status.save!
end
notify_about_mentions!(status) unless status.reblog?
notify_about_reblog!(status) if status.reblog? && status.reblog.account.local?