DEV: Log more when verbose_upload_logging is enabled (#16177)

A message was logged when download started, but it was not known if a error
during the download.
This commit is contained in:
Bianca Nenciu 2022-03-15 23:55:05 +02:00 committed by GitHub
parent 08a1f41582
commit 6a295ea9e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -110,7 +110,11 @@ module Jobs
tmp_file_name: "discourse-hotlinked",
follow_redirect: true
)
rescue
rescue => e
if SiteSetting.verbose_upload_logging
Rails.logger.warn("Verbose Upload Logging: Error '#{e.message}' while downloading #{src}")
end
if (retries -= 1) > 0 && !Rails.env.test?
sleep 1
retry