From 6a295ea9e9880c47eb62c011ab97143c3aea0a97 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Tue, 15 Mar 2022 23:55:05 +0200 Subject: [PATCH] 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. --- app/jobs/regular/pull_hotlinked_images.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/jobs/regular/pull_hotlinked_images.rb b/app/jobs/regular/pull_hotlinked_images.rb index b532366deb5..8ecade8206c 100644 --- a/app/jobs/regular/pull_hotlinked_images.rb +++ b/app/jobs/regular/pull_hotlinked_images.rb @@ -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