Task added to precompute image variants
This commit is contained in:
parent
174f604bbc
commit
d0057e490f
1 changed files with 14 additions and 0 deletions
14
lib/tasks/preprocess_image_variants.rake
Normal file
14
lib/tasks/preprocess_image_variants.rake
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
namespace :debshots do
|
||||
desc "Preprocess image variants to speed up loading times"
|
||||
|
||||
task preprocess_image_variants: :environment do
|
||||
|
||||
ss = Screenshot.all.each do |ss|
|
||||
return unless ss.image.attached?
|
||||
|
||||
Rails.logger.info "Processed variants for #{ss.id} of #{ss.package.name}"
|
||||
ss.medium_image
|
||||
ss.large_image_watermarked
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue