A platform for community discussion. Free, open, simple.
FIX: Always schedule pull_hotlinked_images in cooked_post_processor
David Taylor65b0cafc038d
diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rbindex a8d38ea67dd..92d48bd3016 100644--- a/lib/cooked_post_processor.rb+++ b/lib/cooked_post_processor.rb@@ -626,8 +626,6 @@ class CookedPostProcessorenddef pull_hotlinked_images(bypass_bump = false)- # is the job enabled?- return unless SiteSetting.download_remote_images_to_local?# have we enough disk space?return if disable_if_low_on_disk_space# don't download remote images for posts that are more than n days olddiff --git a/spec/components/cooked_post_processor_spec.rb b/spec/components/cooked_post_processor_spec.rbindex 0df302a423b..43203da4413 100644--- a/spec/components/cooked_post_processor_spec.rb+++ b/spec/components/cooked_post_processor_spec.rb@@ -1082,10 +1082,11 @@ describe CookedPostProcessor dobefore { cpp.stubs(:available_disk_space).returns(90) }- it "does not run when download_remote_images_to_local is disabled" do+ it "runs even when download_remote_images_to_local is disabled" do+ # We want to run it to pull hotlinked optimized imagesSiteSetting.download_remote_images_to_local = false- Jobs.expects(:cancel_scheduled_job).never- cpp.pull_hotlinked_images+ expect { cpp.pull_hotlinked_images }.+ to change { Jobs::PullHotlinkedImages.jobs.count }.by 1endcontext "when download_remote_images_to_local? is enabled" do