mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
BUGFIX: pull hotlinked images job wasn't properly handling the InvalidParameters exception
This commit is contained in:
parent
005f2023a2
commit
5fd4d88491
1 changed files with 4 additions and 1 deletions
|
@ -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 })
|
||||
|
|
Loading…
Reference in a new issue