no verbose logging for failed downloads of gravatars

This commit is contained in:
Sam
2017-09-28 11:32:26 +10:00
parent 165b388158
commit b80320da5e
2 changed files with 8 additions and 3 deletions

View File

@ -20,7 +20,11 @@ class FileHelper
tmp_file_name:,
follow_redirect: false,
read_timeout: 5,
skip_rate_limit: false)
skip_rate_limit: false,
verbose: nil)
# verbose logging is default while debugging onebox
verbose = verbose.nil? ? true : verbose
url = "https:" + url if url.start_with?("//")
raise Discourse::InvalidParameters.new(:url) unless url =~ /^https?:\/\//
@ -32,7 +36,7 @@ class FileHelper
).resolve
unless uri.present?
log(:error, "FinalDestination did not work for: #{url}")
log(:error, "FinalDestination did not work for: #{url}") if verbose
return
end