lower the volume on failed to pull hotlinked image
add more diagnostics
This commit is contained in:
parent
5f5d055a86
commit
82a6176b08
|
@ -41,10 +41,10 @@ module Jobs
|
||||||
upload = Upload.create_for(post.user_id, hotlinked, filename, File.size(hotlinked.path), { origin: src })
|
upload = Upload.create_for(post.user_id, hotlinked, filename, File.size(hotlinked.path), { origin: src })
|
||||||
downloaded_urls[src] = upload.url
|
downloaded_urls[src] = upload.url
|
||||||
else
|
else
|
||||||
Rails.logger.error("Failed to pull hotlinked image: #{src} - Image is bigger than #{@max_size}")
|
Rails.logger.info("Failed to pull hotlinked image for post: #{post_id}: #{src} - Image is bigger than #{@max_size}")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Rails.logger.error("There was an error while downloading '#{src}' locally.")
|
Rails.logger.error("There was an error while downloading '#{src}' locally for post: #{post_id}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# have we successfully downloaded that file?
|
# have we successfully downloaded that file?
|
||||||
|
@ -66,7 +66,7 @@ module Jobs
|
||||||
raw.gsub!(src, "<img src='#{url}'>")
|
raw.gsub!(src, "<img src='#{url}'>")
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error("Failed to pull hotlinked image: #{src}\n" + e.message + "\n" + e.backtrace.join("\n"))
|
Rails.logger.info("Failed to pull hotlinked image: #{src} post:#{post_id}\n" + e.message + "\n" + e.backtrace.join("\n"))
|
||||||
ensure
|
ensure
|
||||||
# close & delete the temp file
|
# close & delete the temp file
|
||||||
hotlinked && hotlinked.close!
|
hotlinked && hotlinked.close!
|
||||||
|
|
|
@ -31,10 +31,7 @@ if Rails.env.production?
|
||||||
/^ActiveRecord::RecordNotFound /,
|
/^ActiveRecord::RecordNotFound /,
|
||||||
|
|
||||||
# bad asset requested, no need to log
|
# bad asset requested, no need to log
|
||||||
/^ActionController::BadRequest /,
|
/^ActionController::BadRequest /
|
||||||
|
|
||||||
# hotlinked image error that is pointless
|
|
||||||
/^Failed to pull hotlinked image.*(404 Not Found|403 Forbidden|gestaddrinfo: Name or service not known)/m
|
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue