mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:10:17 +08:00
FIX: destroy optimized images that cant' be migrated to new scheme
Since we can always recompute an optimized image from the original upload, there's no need to keep optimized images that are generating errors.
This commit is contained in:
parent
fb8ba5e137
commit
87ab1cef8e
|
@ -220,6 +220,8 @@ class OptimizedImage < ActiveRecord::Base
|
|||
end
|
||||
rescue => e
|
||||
problems << { optimized_image: optimized_image, ex: e }
|
||||
# just ditch the optimized image if there was any errors
|
||||
optimized_image.destroy
|
||||
ensure
|
||||
file.try(:unlink) rescue nil
|
||||
file.try(:close) rescue nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user