aq / cws3chk

Check assets are on S3 as Carrierwave says

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cws3chk

This gem checks the existance on S3 of the assets described by ActiveRecord and Carrierwave.

  • It loads the ids of the object with assets in a task and splits them into groups. Each group is going to be processed by a Resque Job.
  • It studies the groups of object by launching n threads. It checks for the existence of the original file and the different versions.
  • It stores the result of the check in Redis.

Installation

Add this line to your application's Gemfile:

gem 'Cws3chk'

And then execute:

$ bundle

Usage

$ bundle exec rake Cws3chk:check

or

request = User.with_avatar
Cws3chk::Checker.new(request, :avatar, 250).check

Then study your missig assets and fix them if needed:

redis.smembers 'Cws3chk::missing'

You can also study the size of the resulting assets:

redis.smembers 'Cws3chk::metadata'

About

Check assets are on S3 as Carrierwave says

License:MIT License


Languages

Language:Ruby 100.0%