FIX: we need the sha of the upload to create a thumbnail

This commit is contained in:
Régis Hanol 2015-06-10 18:15:10 +02:00
parent c1cf602de2
commit bdfdbcd217

View File

@ -8,6 +8,7 @@ class OptimizedImage < ActiveRecord::Base
def self.create_for(upload, width, height, opts={})
return unless width > 0 && height > 0
return if upload.try(:sha1).blank?
DistributedMutex.synchronize("optimized_image_#{upload.id}_#{width}_#{height}") do
# do we already have that thumbnail?