lower the volume on failed to pull hotlinked image

add more diagnostics
This commit is contained in:
Sam 2015-08-19 12:32:31 +10:00
parent 5f5d055a86
commit 82a6176b08
2 changed files with 4 additions and 7 deletions

View File

@ -41,10 +41,10 @@ module Jobs
upload = Upload.create_for(post.user_id, hotlinked, filename, File.size(hotlinked.path), { origin: src })
downloaded_urls[src] = upload.url
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
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
# have we successfully downloaded that file?
@ -66,7 +66,7 @@ module Jobs
raw.gsub!(src, "<img src='#{url}'>")
end
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
# close & delete the temp file
hotlinked && hotlinked.close!

View File

@ -31,10 +31,7 @@ if Rails.env.production?
/^ActiveRecord::RecordNotFound /,
# bad asset requested, no need to log
/^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
/^ActionController::BadRequest /
]
end