no verbose logging for failed downloads of gravatars
This commit is contained in:
parent
165b388158
commit
b80320da5e
|
@ -24,7 +24,8 @@ class UserAvatar < ActiveRecord::Base
|
||||||
gravatar_url,
|
gravatar_url,
|
||||||
max_file_size: SiteSetting.max_image_size_kb.kilobytes,
|
max_file_size: SiteSetting.max_image_size_kb.kilobytes,
|
||||||
tmp_file_name: "gravatar",
|
tmp_file_name: "gravatar",
|
||||||
skip_rate_limit: true
|
skip_rate_limit: true,
|
||||||
|
verbose: false
|
||||||
)
|
)
|
||||||
if tempfile
|
if tempfile
|
||||||
upload = UploadCreator.new(tempfile, 'gravatar.png', origin: gravatar_url, type: "avatar").create_for(user_id)
|
upload = UploadCreator.new(tempfile, 'gravatar.png', origin: gravatar_url, type: "avatar").create_for(user_id)
|
||||||
|
|
|
@ -20,7 +20,11 @@ class FileHelper
|
||||||
tmp_file_name:,
|
tmp_file_name:,
|
||||||
follow_redirect: false,
|
follow_redirect: false,
|
||||||
read_timeout: 5,
|
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?("//")
|
url = "https:" + url if url.start_with?("//")
|
||||||
raise Discourse::InvalidParameters.new(:url) unless url =~ /^https?:\/\//
|
raise Discourse::InvalidParameters.new(:url) unless url =~ /^https?:\/\//
|
||||||
|
@ -32,7 +36,7 @@ class FileHelper
|
||||||
).resolve
|
).resolve
|
||||||
|
|
||||||
unless uri.present?
|
unless uri.present?
|
||||||
log(:error, "FinalDestination did not work for: #{url}")
|
log(:error, "FinalDestination did not work for: #{url}") if verbose
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue