mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
DEV: Include upload_id on image optimization errors to have more context (#19715)
This commit is contained in:
parent
13e9f5054c
commit
d96b4bbb46
@ -85,6 +85,7 @@ class OptimizedImage < ActiveRecord::Base
|
||||
target_quality =
|
||||
upload.target_image_quality(original_path, SiteSetting.image_preview_jpg_quality)
|
||||
opts = opts.merge(quality: target_quality) if target_quality
|
||||
opts = opts.merge(upload_id: upload.id)
|
||||
|
||||
if upload.extension == "svg"
|
||||
FileUtils.cp(original_path, temp_path)
|
||||
@ -343,7 +344,7 @@ class OptimizedImage < ActiveRecord::Base
|
||||
error << " unknown reason"
|
||||
end
|
||||
|
||||
Discourse.warn(error, location: to, error_message: e.message, instructions: instructions)
|
||||
Discourse.warn(error, upload_id: opts[:upload_id], location: to, error_message: e.message, instructions: instructions)
|
||||
false
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user