Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Creates original style twice on S3 #215

Open
davidalejandroaguilar opened this issue May 29, 2018 · 0 comments
Open

Creates original style twice on S3 #215

davidalejandroaguilar opened this issue May 29, 2018 · 0 comments

Comments

@davidalejandroaguilar
Copy link

davidalejandroaguilar commented May 29, 2018

Hi,

For some reason, adding this process_in_background call will create 2 original files in my S3 account; so when I delete the asset, 1 file stays there. What could be causing this? This is my Asset file:

class Asset < ApplicationRecord
  paperclip_options = {
    styles: { hero: '1200x1200>', large: '333x333#', medium: '300x300>', thumb: '200x200#' },
    url: "/system/assets/images/:style-:filename-:hash.:extension",
    hash_secret: ENV['PAPERCLIP_SALT']
  }

  has_attached_file :image, paperclip_options

  unless Rails.env.test?
    paperclip_options.merge!({
      storage: :s3,
      s3_credentials: File.expand_path('../../../aws.yml', __FILE__),
      bucket: ENV['S3_BUCKET_NAME'],
      s3_region: ENV['AWS_REGION'],
      s3_host_name: "s3-#{ENV['AWS_REGION']}.amazonaws.com",
      processors: [:compression]
    })
  end

  process_in_background :image, processing_image_url: -> (attachment) {
    ActionController::Base.helpers.image_path('loading.gif')
  }
end

Using:
delayed_paperclip (3.0.1)
paperclip (5.2.1)
paperclip-compression (1.0.1)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant