Fix error when trying to delete already-deleted file with OpenStack Swift (#27569)
parent
4c38706474
commit
de86e822f4
|
@ -75,7 +75,12 @@ class AttachmentBatch
|
|||
end
|
||||
when :fog
|
||||
logger.debug { "Deleting #{attachment.path(style)}" }
|
||||
|
||||
begin
|
||||
attachment.send(:directory).files.new(key: attachment.path(style)).destroy
|
||||
rescue Fog::Storage::OpenStack::NotFound
|
||||
# Ignore failure to delete a file that has already been deleted
|
||||
end
|
||||
when :azure
|
||||
logger.debug { "Deleting #{attachment.path(style)}" }
|
||||
attachment.destroy
|
||||
|
|
Reference in New Issue