Skip to content

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

Revert `update_columns` -> `update!` when rebaking/post-processing post.

Guo Xiang Tan8794d940d386
diff --git a/app/jobs/regular/process_post.rb b/app/jobs/regular/process_post.rb
index cd99dec5d63..d6b3afa4d27 100644
--- a/app/jobs/regular/process_post.rb
+++ b/app/jobs/regular/process_post.rb
@@ -32,7 +32,7 @@ module Jobs
# TODO suicide if needed, let's gather a few here first
Rails.logger.warn("Cooked post processor in FATAL state, bypassing. You need to urgently restart sidekiq\norig: #{orig_cooked}\nrecooked: #{recooked}\ncooked: #{cooked}\npost id: #{post.id}")
else
- post.update!(cooked: cp.html)
+ post.update_column(:cooked, cp.html)
extract_links(post)
post.publish_change_to_clients! :revised
end
diff --git a/app/models/post.rb b/app/models/post.rb
index b835fea5a39..8bca8c53df9 100644
--- a/app/models/post.rb
+++ b/app/models/post.rb
@@ -603,7 +603,7 @@ class Post < ActiveRecord::Base
new_cooked = cook(raw, topic_id: topic_id, invalidate_oneboxes: invalidate_oneboxes)
old_cooked = cooked
- self.update!(
+ update_columns(
cooked: new_cooked,
baked_at: Time.zone.now,
baked_version: BAKED_VERSION