diff options
Diffstat (limited to 'app/services/unsuspend_account_service.rb')
-rw-r--r-- | app/services/unsuspend_account_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/unsuspend_account_service.rb b/app/services/unsuspend_account_service.rb index f07a3f053..ce9ee48ed 100644 --- a/app/services/unsuspend_account_service.rb +++ b/app/services/unsuspend_account_service.rb @@ -56,10 +56,16 @@ class UnsuspendAccountService < BaseService attachment = media_attachment.public_send(attachment_name) styles = [:original] | attachment.styles.keys + next if attachment.blank? + styles.each do |style| case Paperclip::Attachment.default_options[:storage] when :s3 - attachment.s3_object(style).acl.put(acl: Paperclip::Attachment.default_options[:s3_permissions]) + begin + attachment.s3_object(style).acl.put(acl: Paperclip::Attachment.default_options[:s3_permissions]) + rescue Aws::S3::Errors::NoSuchKey + Rails.logger.warn "Tried to change acl on non-existent key #{attachment.s3_object(style).key}" + end when :fog # Not supported when :filesystem |