Created
January 24, 2014 22:12
-
-
Save laser/8607811 to your computer and use it in GitHub Desktop.
s3 pruner a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class S3FilePruner < JobProcessor | |
def process_job | |
Images.all.select do |image| | |
image.created_at < Date.today - 30 | |
end.each do |image| | |
S3Object.delete image.s3_object_name, image.s3_bucket_name | |
image.destroy | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment