FIX: only call 'unlink' for tempfiles
This commit is contained in:
parent
7ff994b6ea
commit
ad12b2a23d
|
@ -407,8 +407,8 @@ class OptimizedImage < ActiveRecord::Base
|
|||
# just ditch the optimized image if there was any errors
|
||||
optimized_image.destroy
|
||||
ensure
|
||||
file&.unlink
|
||||
file&.close
|
||||
file&.unlink if file&.respond_to?(:unlink)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue