A platform for community discussion. Free, open, simple.
DEV: Remove `bypass_bump` from CookedPostProcessor (#9468)
Jarek Radosz5a81e3999c57
diff --git a/app/jobs/regular/process_post.rb b/app/jobs/regular/process_post.rbindex b13d69d61d8..871e1dbb4ae 100644--- a/app/jobs/regular/process_post.rb+++ b/app/jobs/regular/process_post.rb@@ -23,7 +23,7 @@ module Jobsendcp = CookedPostProcessor.new(post, args)- cp.post_process(bypass_bump: args[:bypass_bump], new_post: args[:new_post])+ cp.post_process(new_post: args[:new_post])# If we changed the document, save itcooked = cp.htmldiff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rbindex 3cbada96b1f..35de12db1b0 100644--- a/lib/cooked_post_processor.rb+++ b/lib/cooked_post_processor.rb@@ -32,7 +32,7 @@ class CookedPostProcessor@omit_nofollow = post.omit_nofollow?end- def post_process(bypass_bump: false, new_post: false)+ def post_process(new_post: false)DistributedMutex.synchronize("post_process_#{@post.id}", validity: 10.minutes) doDiscourseEvent.trigger(:before_post_process_cooked, @doc, @post)remove_full_quote_on_direct_reply if new_post@@ -43,7 +43,7 @@ class CookedPostProcessorremove_user_idsupdate_post_imageenforce_nofollow- pull_hotlinked_images(bypass_bump)+ pull_hotlinked_imagesgrant_badges@post.link_post_uploads(fragments: @doc)DiscourseEvent.trigger(:post_process_cooked, @doc, @post)@@ -655,7 +655,7 @@ class CookedPostProcessorendend- def pull_hotlinked_images(bypass_bump = false)+ def pull_hotlinked_images# have we enough disk space?disable_if_low_on_disk_space # But still enqueue the job# don't download remote images for posts that are more than n days old@@ -666,7 +666,7 @@ class CookedPostProcessorJobs.cancel_scheduled_job(:pull_hotlinked_images, post_id: @post.id)# schedule the jobdelay = SiteSetting.editing_grace_period + 1- Jobs.enqueue_in(delay.seconds.to_i, :pull_hotlinked_images, post_id: @post.id, bypass_bump: bypass_bump)+ Jobs.enqueue_in(delay.seconds.to_i, :pull_hotlinked_images, post_id: @post.id)enddef disable_if_low_on_disk_spacediff --git a/spec/components/cooked_post_processor_spec.rb b/spec/components/cooked_post_processor_spec.rbindex d9866515626..3d79bcf25fb 100644--- a/spec/components/cooked_post_processor_spec.rb+++ b/spec/components/cooked_post_processor_spec.rb@@ -1529,7 +1529,7 @@ describe CookedPostProcessor doJobs.expects(:cancel_scheduled_job).with(:pull_hotlinked_images, post_id: post.id).oncedelay = SiteSetting.editing_grace_period + 1- Jobs.expects(:enqueue_in).with(delay.seconds, :pull_hotlinked_images, post_id: post.id, bypass_bump: false).once+ Jobs.expects(:enqueue_in).with(delay.seconds, :pull_hotlinked_images, post_id: post.id).oncecpp.pull_hotlinked_imagesend@@ -1603,7 +1603,7 @@ describe CookedPostProcessor doJobs.expects(:cancel_scheduled_job).with(:pull_hotlinked_images, post_id: post.id).oncedelay = SiteSetting.editing_grace_period + 1- Jobs.expects(:enqueue_in).with(delay.seconds, :pull_hotlinked_images, post_id: post.id, bypass_bump: false).once+ Jobs.expects(:enqueue_in).with(delay.seconds, :pull_hotlinked_images, post_id: post.id).oncecpp.pull_hotlinked_imagesend