From 5fd4d88491ece47364c1a480241e83bd7cacebf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 22 Apr 2014 15:32:48 +0200 Subject: [PATCH] BUGFIX: pull hotlinked images job wasn't properly handling the InvalidParameters exception --- app/jobs/regular/pull_hotlinked_images.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/jobs/regular/pull_hotlinked_images.rb b/app/jobs/regular/pull_hotlinked_images.rb index 1e179af29..e7142b9ee 100644 --- a/app/jobs/regular/pull_hotlinked_images.rb +++ b/app/jobs/regular/pull_hotlinked_images.rb @@ -31,7 +31,10 @@ module Jobs begin # have we already downloaded that file? if !downloaded_urls.include?(src) - hotlinked = FileHelper.download(src, @max_size, "discourse-hotlinked") rescue Discourse::InvalidParameters + begin + hotlinked = FileHelper.download(src, @max_size, "discourse-hotlinked") + rescue Discourse::InvalidParameters + end if hotlinked.try(:size) <= @max_size filename = File.basename(URI.parse(src).path) upload = Upload.create_for(post.user_id, hotlinked, filename, hotlinked.size, { origin: src })