Skip to content

Instantly share code, notes, and snippets.

@pzaich
Created August 5, 2013 16:56
Show Gist options
  • Save pzaich/6157498 to your computer and use it in GitHub Desktop.
Save pzaich/6157498 to your computer and use it in GitHub Desktop.
Delayed_paperclip setup using Sidekiq
###gemfile
gem 'paperclip' ## 3.5.1, also 3.4.2 previously
gem 'delayed_paperclip'
gem 'sidekiq', '2.6.4'
### image.rb
attr_accessible :photo_processing
has_attached_file :photo,
styles: {
default: '480x360#',
square: '200x200#'
},
convert_options: { default: '-interlace Plane -quality 85', square: '-interlace Plane -quality 85' },
storage: :s3,
bucket: 'workhands_images',
default_url: "/assets/license_avatar.jpg"
process_in_background :photo, processing_image_url: '/assets/processing-image.png'
### sidekiq.yml
:concurrency: 7
:queues:
- [high, 7]
- [default, 5]
- [paperclip, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment